Skip to content

Commit df25db9

Browse files
authored
Merge pull request #8 from perl-actions/custom
Custom installation with args
2 parents 1d374c5 + 0f3cbe6 commit df25db9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ Possible values: true | false [default: true]
8888

8989
Extra arguments to pass to the cpm command line.
9090

91+
You can also use this option to run your own flavor
92+
without the need of setting `install` or `cpanfile`.
93+
```yaml
94+
args: "--installdeps ."
95+
```
96+
9197
### `sudo`
9298

9399
Run commands as sudo: true | false [default: true]

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ async function run() {
125125
CMD_install = CMD_install.concat(w_args);
126126
}
127127

128+
var has_run = false;
129+
128130
/* install one ore more modules */
129131
if (install !== null && install.length) {
130132
// install one or more modules
@@ -134,6 +136,7 @@ async function run() {
134136
var cmd = [...CMD_install]; /* clone array */
135137
cmd = cmd.concat(list);
136138

139+
has_run = true;
137140
await do_exec(cmd);
138141
}
139142

@@ -146,6 +149,16 @@ async function run() {
146149

147150
var cmd = [...CMD_install];
148151
cmd.push("--cpanfile", cpanfile_full_path);
152+
153+
has_run = true;
154+
await do_exec(cmd);
155+
}
156+
157+
/* custom run with args */
158+
if ( has_run === false && w_args.length ) {
159+
console.log(`custom run with args`);
160+
var cmd = [...CMD_install];
161+
has_run = true;
149162
await do_exec(cmd);
150163
}
151164
}

0 commit comments

Comments
 (0)