Skip to content

Commit e3f106d

Browse files
committed
Can run cpanm without install or cpanfile
1 parent f4a5e12 commit e3f106d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,19 @@ Possible values: true | false [default: false]
7878

7979
### `args`
8080

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

8383
example:
84-
8584
```yaml
8685
args: "-L vendor"
8786
```
8887

88+
You can also use this option to run your own flavor
89+
without the need of setting `install` or `cpanfile`.
90+
```yaml
91+
args: "--installdeps ."
92+
```
93+
8994
### `sudo`
9095

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

index.js

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

118+
var has_run = false;
119+
118120
/* install one ore more modules */
119121
if (install !== null && install.length) {
120122
// install one or more modules
@@ -124,6 +126,7 @@ async function run() {
124126
var cmd = [...CMD_install]; /* clone array */
125127
cmd = cmd.concat(list);
126128

129+
has_run = true;
127130
await do_exec(cmd);
128131
}
129132

@@ -136,6 +139,16 @@ async function run() {
136139

137140
var cmd = [...CMD_install];
138141
cmd.push("--cpanfile", cpanfile_full_path, "--installdeps", ".");
142+
143+
has_run = true;
144+
await do_exec(cmd);
145+
}
146+
147+
/* custom run with args */
148+
if ( has_run === false && w_args.length ) {
149+
console.log(`custom run with args`);
150+
var cmd = [...CMD_install];
151+
has_run = true;
139152
await do_exec(cmd);
140153
}
141154

0 commit comments

Comments
 (0)