From b785412739cf508b4e03b9b467ee6924bda305b8 Mon Sep 17 00:00:00 2001 From: Guilherme Mota Date: Thu, 23 Nov 2023 14:44:01 -0300 Subject: [PATCH] Adding support to semantic versioning solving issue #1 - Supporting version kynd 1.0.0-rc.0 - Solving issue #1 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 705865d..05fc307 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,7 @@ exports.getVersion = function (packageDir) { // check if file is present pathName = path.join(pathName, 'package.json'); if(fs.existsSync(pathName)) { - return fs.readFileSync(pathName).toString().match(/"version"\s*:\s*"([\d.]+)"/)[1]; + return fs.readFileSync(pathName).toString().match(/"version"\s*:\s*"([\d.|\d-]+)"/)[1]; } return ""; }; @@ -143,4 +143,4 @@ exports.deepMerge = function() { }; -// -- EOF \ No newline at end of file +// -- EOF