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:
parent
dc114d1e4f
commit
4a2e61d61b
2 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue