Skip to content

Commit

Permalink
Update parser.ts to fully support semver (#15)
Browse files Browse the repository at this point in the history
* Update parser.ts to fully support semver

* Update parser.ts
  • Loading branch information
flleeppyy authored Jul 25, 2023
1 parent 047c881 commit 3370e14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export function parseFile(file: string, defineName: string): string{
if(defineName !== ""){
var regex = new RegExp(`\\s*\\#define\\s+${defineName}\\s+(?:\\"|\\')([\\d.]+)`);
var regex = new RegExp(/\s*\#define\s+/.source + defineName + /\s+(?:"|\')(.*)"/.source);
}
else{
var regex = /\s*version\s*=\s*(?:\"|\')([\d.]+)/;
Expand All @@ -18,4 +18,4 @@ export function parseFile(file: string, defineName: string): string{
}
}
return parsedVersion;
}
}

0 comments on commit 3370e14

Please sign in to comment.