Skip to content

Commit 9a9088a

Browse files
authored
Merge pull request #7 from perl-actions/addons
Can run cpanm without install or cpanfile
2 parents b9e0211 + e3f106d commit 9a9088a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,19 @@ this is now disabled to speedup installations.
8686

8787
### `args`
8888

89-
Extra arguments to pass to the cpanm command line.
89+
Extra arguments to pass to the cpanm command line used by `install` or `cpanfile`.
9090

9191
example:
92-
9392
```yaml
9493
args: "-L vendor"
9594
```
9695

96+
You can also use this option to run your own flavor
97+
without the need of setting `install` or `cpanfile`.
98+
```yaml
99+
args: "--installdeps ."
100+
```
101+
97102
### `sudo`
98103

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

index.js

+13
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ async function run() {
121121
CMD_install = CMD_install.concat(w_args);
122122
}
123123

124+
var has_run = false;
125+
124126
/* install one ore more modules */
125127
if (install !== null && install.length) {
126128
// install one or more modules
@@ -130,6 +132,7 @@ async function run() {
130132
var cmd = [...CMD_install]; /* clone array */
131133
cmd = cmd.concat(list);
132134

135+
has_run = true;
133136
await do_exec(cmd);
134137
}
135138

@@ -142,6 +145,16 @@ async function run() {
142145

143146
var cmd = [...CMD_install];
144147
cmd.push("--cpanfile", cpanfile_full_path, "--installdeps", ".");
148+
149+
has_run = true;
150+
await do_exec(cmd);
151+
}
152+
153+
/* custom run with args */
154+
if ( has_run === false && w_args.length ) {
155+
console.log(`custom run with args`);
156+
var cmd = [...CMD_install];
157+
has_run = true;
145158
await do_exec(cmd);
146159
}
147160

0 commit comments

Comments
 (0)