Skip to content

Commit 1721726

Browse files
committed
🔧 fix config parse order #2271
1 parent ab52fc0 commit 1721726

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/cli/setup.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,23 +362,31 @@ export const cli: () => {
362362
booleanDefault: undefined
363363
});
364364

365+
/**
366+
* Config order should follow airmanship rules. Least maneuverable to most maneuverable.
367+
*
368+
* 1. ENV VARS
369+
* 2. Config file
370+
* 3. CLI flags
371+
*/
372+
365373
const cliConfig: any = {
366374
sessionId: "session",
367375
/**
368376
* Prioirity goes from bottom up
369377
*/
370378
/**
371-
* CLI flags
379+
* Environmental Variables
372380
*/
373-
..._cli.flags,
381+
...envArgs(),
374382
/**
375383
* The configuration file OR the --config base64 encoded config object
376384
*/
377385
...(configFile(_cli.flags.config as string) || {}),
378386
/**
379-
* Environmental Variables
387+
* CLI flags
380388
*/
381-
...envArgs()
389+
..._cli.flags
382390
};
383391

384392
const PORT = Number(cliConfig.port || process.env.PORT || 8080);

0 commit comments

Comments
 (0)