Skip to content

Commit

Permalink
feat(alias): support per project alias that overrides common alias
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Jun 27, 2019
1 parent 1257f5f commit 5762348
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,14 @@ program

program.on('command:*', async (args) => {
const alias = args.shift();
const cmd = conf.get(`alias:${alias}`);
let cmd = conf.get(`alias:${alias}`);
const pkg = path.join(process.cwd(), '/package.json');

// package.json alias overrides the common alias
if (fs.existsSync(pkg)) {
const {gitflow: {alias: aliases = {}} = {}} = require(pkg);
cmd = aliases[alias] || cmd;
}

try {
if (!cmd) {
Expand Down

0 comments on commit 5762348

Please sign in to comment.