Skip to content

Commit

Permalink
Merge pull request #8 from perl-actions/custom
Browse files Browse the repository at this point in the history
Custom installation with args
  • Loading branch information
atoomic authored Nov 5, 2020
2 parents 1d374c5 + 0f3cbe6 commit df25db9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -134,6 +136,7 @@ async function run() {
var cmd = [...CMD_install]; /* clone array */
cmd = cmd.concat(list);

has_run = true;
await do_exec(cmd);
}

Expand All @@ -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);
}
}
Expand Down

0 comments on commit df25db9

Please sign in to comment.