Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: do not open main file in development (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl authored and markusoelhafen committed Sep 25, 2018
1 parent bd0cf5e commit f9a7509
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ const CONTEXT: AppContext = Mobx.observable({
});

async function main(): Promise<void> {
if (process.argv.length > 1) {
const fileToOpenArg = process.argv[1];
CONTEXT.fileToOpen = fileToOpenArg;
const args = yargsParser(process.argv.slice(2));
const fileToOpen = args._.length > 0 ? args._[0] : '';

if (fileToOpen && Path.extname(fileToOpen) === '.alva') {
CONTEXT.fileToOpen = fileToOpen;
}

const args = yargsParser(process.argv.slice(2));
CONTEXT.hot = args.hot || false;
CONTEXT.base = args.base || '';

Expand Down

0 comments on commit f9a7509

Please sign in to comment.