Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Parrryy committed Feb 2, 2018
1 parent 2e3257b commit c9f615f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions broccoli/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ module.exports.VERSION = (() => {
// * the sha for the commit
let packageVersion = pkg.version;
let sha = info.sha || '';
// * remove illegal non-alphanumeric characters from branch name.
if(info.branch !== null && new RegExp(/[^a-zA-Z\d\s-]/).test(info.branch)) {
info.branch = info.branch.replace(/[^a-zA-Z\d\s-]/, '-');
}
let suffix = process.env.BUILD_TYPE || info.branch;
// * remove illegal non-alphanumeric characters from branch name.
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 c9f615f

Please sign in to comment.