Skip to content

Commit 2e99d1f

Browse files
author
Robert Jackson
committed
[BUGFIX beta] Fix version with many special chars.
The current sanitizer regexp works well when there is a single invalid character, but does not handle the case where multiple invalid chars are present (e.g. with a branch name of `__DESCRIPTOR__-something__something/special`).
1 parent 3a537b5 commit 2e99d1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

broccoli/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports.VERSION = (() => {
2929
let sha = info.sha || '';
3030
let suffix = process.env.BUILD_TYPE || info.branch;
3131
// * remove illegal non-alphanumeric characters from branch name.
32-
suffix = suffix && suffix.replace(/[^a-zA-Z\d\s-]/, '-');
32+
suffix = suffix && suffix.replace(/[^a-zA-Z\d\s-]/g, '-');
3333
let metadata = sha.slice(0, 8);
3434

3535
return `${packageVersion}${suffix ? '-' + suffix : ''}+${metadata}`;

0 commit comments

Comments
 (0)