1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2025-12-10 14:02:44 +00:00

Added header parsing (no need to use "project:" statement anymore for project definition)

This commit is contained in:
Filip Makowski 2017-06-05 12:19:09 +02:00
parent dc114d1e4f
commit 4a2e61d61b
2 changed files with 4 additions and 3 deletions

View file

@ -45,10 +45,11 @@ QtObject {
function getProjectNameAndRun(str, func) {
// We are trying to get the name of the project.
// To do so, we are getting the substring of a line by using regexp group.
var projectRegExp = /project:[\s*]?(.+)?[\s*]?/i;
var projectRegExp = /(project:[\s*]?(.+)?[\s*]?)|(#+[\s*]?(.+)?[\s*]?)/i;
var isProjectName = projectRegExp.exec(str);
if (isProjectName) {
func(isProjectName[1]);
var projectName = isProjectName[2] ? isProjectName[2] : isProjectName[4];
func(projectName);
return true;
}
}