diff --git a/multichain-testing/tools/agd-lib.js b/multichain-testing/tools/agd-lib.js index a28d408493b..71ed0f69cbd 100644 --- a/multichain-testing/tools/agd-lib.js +++ b/multichain-testing/tools/agd-lib.js @@ -16,7 +16,7 @@ const binaryArgs = [ ]; /** - * @param {Record} record - e.g. { color: 'blue' } + * @param {Record} record - e.g. { color: 'blue' } * @returns {string[]} - e.g. ['--color', 'blue'] */ export const flags = record => { @@ -25,7 +25,12 @@ export const flags = record => { /** @type {[string, string][]} */ // @ts-expect-error undefined is filtered out const skipUndef = Object.entries(record).filter(([_k, v]) => v !== undefined); - return skipUndef.map(([k, v]) => [`--${k}`, v]).flat(); + return skipUndef.flatMap(([key, value]) => { + if (Array.isArray(value)) { + return value.flatMap(v => [`--${key}`, v]); + } + return [`--${key}`, value]; + }); }; /** diff --git a/multichain-testing/tools/deploy.ts b/multichain-testing/tools/deploy.ts index 52a460f6094..289c4d971e9 100755 --- a/multichain-testing/tools/deploy.ts +++ b/multichain-testing/tools/deploy.ts @@ -13,7 +13,7 @@ export const makeDeployBuilder = ( ) => async function deployBuilder( builder: string, - builderOpts?: Record, + builderOpts?: Record, ) { console.log(`building plan: ${builder}`); const args = ['run', builder];