Skip to content

Commit

Permalink
feat: Add replacement character for the branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Sep 26, 2018
1 parent 2900829 commit f4b7302
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/config/base-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const DEFAULT_CONFIG = {
*
*/
skipTest: false,
/**
*
*/
charReplacement: '-',
/**
*
*/
Expand Down
4 changes: 4 additions & 0 deletions src/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class Config extends Map {
this.load();
}

get charReplacement() {
return this.get('charReplacement');
}

/**
*
* @returns {*}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/normalize-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const config = require('../config');

module.exports = {
normalizeBranchName({ fromBranch, branchName, type }) {
const paths = [type || config.branchTypes.default, branchName.replace(/[- /]/gi, '_')];
const paths = [type || config.branchTypes.default, branchName.replace(/[- _/]/gi, config.charReplacement)];

fromBranch = fromBranch.replace(`${config.remote}/`, '');

Expand Down

0 comments on commit f4b7302

Please sign in to comment.