diff --git a/README.md b/README.md index 6138303..8cf9c65 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,12 @@ Possible values: true | false [default: true] Extra arguments to pass to the cpm command line. +You can also use this option to run your own flavor +without the need of setting `install` or `cpanfile`. +```yaml +args: "--installdeps ." +``` + ### `sudo` Run commands as sudo: true | false [default: true] diff --git a/index.js b/index.js index 32519fb..74cc81a 100644 --- a/index.js +++ b/index.js @@ -125,6 +125,8 @@ async function run() { CMD_install = CMD_install.concat(w_args); } + var has_run = false; + /* install one ore more modules */ if (install !== null && install.length) { // install one or more modules @@ -134,6 +136,7 @@ async function run() { var cmd = [...CMD_install]; /* clone array */ cmd = cmd.concat(list); + has_run = true; await do_exec(cmd); } @@ -146,6 +149,16 @@ async function run() { var cmd = [...CMD_install]; cmd.push("--cpanfile", cpanfile_full_path); + + has_run = true; + await do_exec(cmd); + } + + /* custom run with args */ + if ( has_run === false && w_args.length ) { + console.log(`custom run with args`); + var cmd = [...CMD_install]; + has_run = true; await do_exec(cmd); } }