mirror of
https://github.com/laurent22/joplin.git
synced 2026-10-25 02:47:28 +00:00
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
421 B
TypeScript
12 lines
421 B
TypeScript
// Flags are parsed properly in BaseApplication, however it's better to have
|
|
// the env as early as possible to enable debugging capabilities.
|
|
const envFromArgs = (args: string[] | null | undefined): 'dev' | 'prod' => {
|
|
if (!args) return 'prod';
|
|
const envIndex = args.indexOf('--env');
|
|
const devIndex = args.indexOf('dev');
|
|
if (envIndex === devIndex - 1) return 'dev';
|
|
return 'prod';
|
|
};
|
|
|
|
export default envFromArgs;
|