File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ let filteredTags = [];
90
90
* @returns number array or undefined
91
91
*/
92
92
function parseVersion ( str ) {
93
- const versionReg = / ^ v ? ( \d + ) \. ( \d + ) \. ( \d + ) $ / i;
93
+ // there is no ending "$", because of "rc"-like versions
94
+ const versionReg = / ^ v ? ( \d + ) \. ( \d + ) \. ( \d + ) / i;
94
95
95
96
const match = versionReg . exec ( str ) ;
96
97
@@ -105,12 +106,23 @@ function parseVersion(str) {
105
106
return parsed ;
106
107
}
107
108
109
+ // special case, to not log a warning
110
+ if ( str === "test" ) {
111
+ return undefined ;
112
+ }
113
+
114
+ console . log ( `Failed to parse version! got: ${ str } ` ) ;
115
+
108
116
return undefined ;
109
117
}
110
118
119
+ /**
120
+ * Get versions from git tags and put them into {@link filteredTags}
121
+ */
111
122
function getVersions ( ) {
112
123
// get all tags from git
113
- const res = childProcess . execSync ( "git tag" ) . toString ( ) ;
124
+ // "trim" is used to remove the ending new-line
125
+ const res = childProcess . execSync ( "git tag" ) . toString ( ) . trim ( ) ;
114
126
115
127
filteredTags = res . split ( '\n' )
116
128
// map all gotten tags if they match the regular expression
You can’t perform that action at this time.
0 commit comments