Skip to content

Commit

Permalink
Merge pull request #16200 from Parrryy/fix/yarn-test-illegal-characte…
Browse files Browse the repository at this point in the history
…r-bug

[BUGFIX beta] prevent test error by converting illegal characters
  • Loading branch information
rwjblue authored Feb 2, 2018
2 parents 596951d + d1bc83d commit adcae3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion broccoli/version.js
Original file line number Diff line number Diff line change
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 adcae3a

Please sign in to comment.