From a7969400642f6be083789e328a5a0486a61c7c2b Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 23 Apr 2014 08:51:44 -0400 Subject: [PATCH] closed #1421 use --no-daemon flag to... not daemonize. Also, install script can be canceled without throwing errors. --- loader.js | 2 +- nodebb | 10 +++++----- src/install.js | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/loader.js b/loader.js index 13400d67d8..389412fdef 100644 --- a/loader.js +++ b/loader.js @@ -76,7 +76,7 @@ var nconf = require('nconf'), nconf.argv(); // Start the daemon! -if (nconf.get('d')) { +if (nconf.get('daemon') !== false) { // Check for a still-active NodeBB process if (fs.existsSync(pidFilePath)) { try { diff --git a/nodebb b/nodebb index e88744c081..ea3a82a77f 100755 --- a/nodebb +++ b/nodebb @@ -77,31 +77,31 @@ case "$1" in npm install ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm install ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update - node loader --upgrade + node app --upgrade touch package.json echo -e "\n\e[00;32mNodeBB Dependencies up-to-date!\e[00;00m"; ;; setup) - node loader --setup "$@" + node app --setup "$@" ;; reset) - node loader --reset --$2 + node app --reset --$2 ;; dev) echo "Launching NodeBB in \"development\" mode." echo "To run the production build of NodeBB, please use \"forever\"." echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" - NODE_ENV=development node loader "$@" + NODE_ENV=development node loader --no-daemon "$@" ;; watch) echo "Launching NodeBB in \"development\" mode." echo "To run the production build of NodeBB, please use \"forever\"." echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" - NODE_ENV=development supervisor -q --ignore public/templates --extensions 'node|js|tpl' -- app "$@" + NODE_ENV=development supervisor -q --ignore public/templates --extensions 'node|js|tpl' -- loader --no-daemon "$@" ;; *) diff --git a/src/install.js b/src/install.js index b165c2a344..f21dab1224 100644 --- a/src/install.js +++ b/src/install.js @@ -140,6 +140,12 @@ function setupConfig(next) { if (!install.values) { prompt.get(questions.main, function(err, config) { + if (err) { + process.stdout.write('\n\n'); + winston.warn('NodeBB setup ' + err.message); + process.exit(); + } + if (nconf.get('advanced')) { prompt.get({ name: 'secondary_database',