diff --git a/packages/core/bin/config/testnet/app.js b/packages/core/bin/config/testnet/app.js index e14163f34a..7a0b76b697 100644 --- a/packages/core/bin/config/testnet/app.js +++ b/packages/core/bin/config/testnet/app.js @@ -36,4 +36,4 @@ module.exports = { }, }, }, -} \ No newline at end of file +}; diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 1d1fcb647f..a55495ae61 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -33,16 +33,26 @@ export const updateEnvironmentVariables = (envFile: string, variables: Environme }; export const getCliConfig = ( - options: Record, + flags: Record, paths: envPaths.Paths, defaultValue = {}, ): Record => { - const configPath: string = `${paths.config}/app.js`; - if (!existsSync(configPath)) { + const configPaths: string[] = [`${paths.config}/app.js`, resolve(__dirname, `../bin/config/${flags.network}/app.js`)]; + + let configPath: string; + for (const path of configPaths) { + if (existsSync(path)) { + configPath = path; + + break; + } + } + + if (!configPath) { return defaultValue; } - const key: string = `cli.${options.suffix}.run.plugins`; + const key: string = `cli.${flags.suffix}.run.plugins`; const configuration = require(resolve(configPath)); if (!dottie.exists(configuration, key)) { return defaultValue;