Skip to content

Commit b799cea

Browse files
committed
feat(config): allow for arrays of commands
1 parent 488500b commit b799cea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/verify-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ const VALIDATORS = {
1414
module.exports = (cmdProp, {shell, execCwd, ...pluginConfig}) => {
1515
const cmd = pluginConfig[cmdProp] ? cmdProp : pluginConfig.cmd ? 'cmd' : cmdProp;
1616

17+
// join arrays of commands into a single command
18+
if (Array.isArray(pluginConfig[cmd])) {
19+
pluginConfig[cmd] = pluginConfig[cmd].join(' && ');
20+
}
21+
1722
const errors = Object.entries({shell, execCwd, cmd: pluginConfig[cmd]}).reduce(
1823
(errors, [option, value]) =>
1924
VALIDATORS[option](value)

0 commit comments

Comments
 (0)