diff --git a/lib/wilfred.js b/lib/wilfred.js index d1f2dc5..fed9873 100644 --- a/lib/wilfred.js +++ b/lib/wilfred.js @@ -23,6 +23,7 @@ program .option('-l, --list', 'Returns the list of boilerplates') .option('-r, --remove', 'Remove boilerplate by name') .option('-s, --silent', 'Run in silent mode (requires passing at least boilerplate parameter)') + .option('-p, --path [name]', 'Returns path to a boilerplate by its name') .parse(process.argv) class Wilfred { @@ -42,6 +43,16 @@ class Wilfred { return this.remove(); } + if(program.path) { + var bp = this.config.boilerplates.find(item => item.boilerplate === program.path); + if(bp) { + console.log(bp.path); + } else { + console.log('Boilerplate not found...'); + } + return; + } + if (program.add) { this.questions = [ {