Skip to content

Commit 52ce6b1

Browse files
committed
fix(args): always parse command args and interpolate all occurances
1 parent e1c88e5 commit 52ce6b1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/cli.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if (!packageConfig && !doprConfig) {
6565
}
6666

6767
// Backward compat.
68-
if (typeof packageConfig.file === 'string') {
68+
if (packageConfig && typeof packageConfig.file === 'string') {
6969
packageConfig.file = [packageConfig.file];
7070
}
7171
if (doprConfig && typeof doprConfig.file === 'string') {
@@ -172,17 +172,16 @@ cliAction.command.forEach(command => {
172172
return exitHandler(spawnSync('dopr ', refArgs, cliOptions).status);
173173
}
174174

175+
// Parse command
176+
const cliCommand = command
177+
.replace(/%action%/g, action || '')
178+
.replace(/%args%/g, args.join(' '));
179+
175180
// Command is expected to run in host context!
176181
if (cliAction.service === '@host') {
177-
return execSync(command, cliOptions);
182+
return execSync(cliCommand, cliOptions);
178183
}
179184

180-
// Parse command
181-
const cliCommand = command
182-
.replace('%action%', action || '')
183-
.replace('%args%', args.join(' '))
184-
.split(' ');
185-
186185
// Args
187186
const user = cliAction.user ? ['--user', cliAction.user] : [];
188187

0 commit comments

Comments
 (0)