From b799cea96ae0da541111b4fdeb5af0574a2f86a5 Mon Sep 17 00:00:00 2001 From: Arimil Date: Sat, 24 Jun 2023 17:23:16 -0400 Subject: [PATCH] feat(config): allow for arrays of commands --- lib/verify-config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/verify-config.js b/lib/verify-config.js index db65ce1f..291757ce 100644 --- a/lib/verify-config.js +++ b/lib/verify-config.js @@ -14,6 +14,11 @@ const VALIDATORS = { module.exports = (cmdProp, {shell, execCwd, ...pluginConfig}) => { const cmd = pluginConfig[cmdProp] ? cmdProp : pluginConfig.cmd ? 'cmd' : cmdProp; + // join arrays of commands into a single command + if (Array.isArray(pluginConfig[cmd])) { + pluginConfig[cmd] = pluginConfig[cmd].join(' && '); + } + const errors = Object.entries({shell, execCwd, cmd: pluginConfig[cmd]}).reduce( (errors, [option, value]) => VALIDATORS[option](value)