@bowtie/cli
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "@bowtie/cli", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Internal BowTie CLI Tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,2 +34,8 @@ const Cmr1Cli = require('cmr1-cli') | ||
const isMakeable = (action) => { | ||
const targetRegExp = new RegExp(`^${action}:`, 'm') | ||
return info.context.make && targetRegExp.test(info.context.makefile) | ||
} | ||
const handleAction = (args) => { | ||
@@ -41,3 +47,13 @@ const action = args.shift() | ||
if (!actions[action]) { | ||
if (isMakeable(action)) { | ||
cli.log(`Delegating action to Makefile: ${action}`) | ||
args.unshift(action) | ||
actions.make.run({ | ||
cli, | ||
info, | ||
args | ||
}) | ||
} else if (!actions[action]) { | ||
cli.warn(`Action: '${action}' is invalid`) | ||
@@ -44,0 +60,0 @@ cli.showHelp() |
@@ -34,4 +34,9 @@ const os = require('os') | ||
} | ||
if (/makefile/i.test(file)) { | ||
info.context.make = true | ||
info.context.makefile = fs.readFileSync(file) | ||
} | ||
}) | ||
module.exports = info |
Sorry, the diff of this file is not supported yet
1451601
68
1659