From 5d015fc668b52ffa096091ade191a89d9f4f056f Mon Sep 17 00:00:00 2001 From: Kylart Date: Thu, 2 Aug 2018 12:51:00 +0200 Subject: [PATCH] Removed detached option --- app/bin.js | 6 ------ app/electron/runner.js | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/bin.js b/app/bin.js index 3d94349..2701bc2 100755 --- a/app/bin.js +++ b/app/bin.js @@ -15,11 +15,6 @@ function start (name, sub, opts) { const electronProcess = require(join(__dirname, 'electron', 'runner.js'))(opts) console.log(`> App started with pid ${electronProcess.pid}.`) } else { - if (opts.detached) { - console.log('\tCannot start detached server. You might never be able to close it.') - console.log('\tIf you really wish to do so, please contact me on Discord or by mail: kylart.dev@gmail.com\n\n') - } - require(__dirname) } } @@ -28,7 +23,6 @@ function init () { args .option('port', 'The port on which the app will be running', port) .option('server', 'If set to true, KawAnime will start in server-only mode', false) - .option('detached', 'If set to true, the control of your console will be given back to you', false) .option('verbose', 'Whether or not you want to see logs', false) .command('start', 'Start the app', start) diff --git a/app/electron/runner.js b/app/electron/runner.js index 838e233..996cfce 100644 --- a/app/electron/runner.js +++ b/app/electron/runner.js @@ -2,10 +2,10 @@ const electron = require('electron') const { join } = require('path') const { spawn } = require('child_process') -function init ({detached, verbose}) { - const electronProcess = spawn(electron, [join(__dirname, '..', 'index.js')], { detached }) +function init ({verbose}) { + const electronProcess = spawn(electron, [join(__dirname, '..', 'index.js')]) - if (!detached && verbose) { + if (verbose) { electronProcess.stdout.on('data', (data) => { process.stdout.write(data) })