Skip to content

Commit

Permalink
[BUGFIX beta] prevent test error by converting illegal characters in …
Browse files Browse the repository at this point in the history
…branch name

null fix

(cherry picked from commit d1bc83d)
  • Loading branch information
Parrryy authored and kategengler committed Feb 6, 2018
1 parent 8fcdc6a commit 5658610
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion broccoli/version.js
Expand Up @@ -25,9 +25,11 @@ module.exports.VERSION = (() => {
// * current "build type" or branch name (in CI this is generally not
// present, but it is very useful for local / testing builds)
// * the sha for the commit
let packageVersion = pkg.version;
let packageVersion = pkg.version;
let sha = info.sha || '';
let suffix = process.env.BUILD_TYPE || info.branch;
// * remove illegal non-alphanumeric characters from branch name.
suffix = suffix && suffix.replace(/[^a-zA-Z\d\s-]/, '-');
let metadata = sha.slice(0, 8);

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

0 comments on commit 5658610

Please sign in to comment.