From 3370e14af830debb987bc197e59bf0ac48a17e81 Mon Sep 17 00:00:00 2001 From: Flleeppyy <18307183+flleeppyy@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:37:56 -0700 Subject: [PATCH] Update parser.ts to fully support semver (#15) * Update parser.ts to fully support semver * Update parser.ts --- src/utils/parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/parser.ts b/src/utils/parser.ts index 830cc1f..0c674f3 100644 --- a/src/utils/parser.ts +++ b/src/utils/parser.ts @@ -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.]+)/; @@ -18,4 +18,4 @@ export function parseFile(file: string, defineName: string): string{ } } return parsedVersion; -} \ No newline at end of file +}