Skip to content

Commit

Permalink
CLI WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Dec 11, 2018
1 parent a7ccd35 commit ac0e3b9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/app/main/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,19 @@ const startEmulator = () => {

// path to electron exe
const electronPath = args[0];
console.log('ELECTRON PATH: ', electronPath);
// path to app entry point
const main = join(__dirname, 'main.js');
console.log('MAIN PATH: ', main);
// pass args to app (prune '.' from end; will be replaced with path to entry point)
const argsToPass = args.slice(1, args.length - 1);
const argsToPass = args.slice(1, args.length - 1) || [];
console.log('args to pass: ', argsToPass);

console.log('DIRNAME: ', __dirname);
console.log('CWD: ', process.cwd());

const out = openSync(join(process.cwd(), './out.log'), 'a');
const err = openSync(join(process.cwd(), './err.log'), 'a');
// const out = openSync(join(process.cwd(), './out.log'), 'a');
// const err = openSync(join(process.cwd(), './err.log'), 'a');

console.log('spawning sub process');
const child = spawn(
Expand All @@ -67,7 +69,7 @@ const startEmulator = () => {
],
{
detached: true,
stdio: ['ignore', out, err]
stdio: 'ignore' // ['ignore', out, err]
}
);
child.unref();
Expand Down

0 comments on commit ac0e3b9

Please sign in to comment.