From 7cec15ce1ad51c07441317780f352eb344510305 Mon Sep 17 00:00:00 2001 From: Joseph Huckaby Date: Sun, 10 Jan 2016 10:21:29 -0800 Subject: [PATCH] Reduced console output, now only emitting each storage command in verbose mode. Cleaned up spacing a bit. --- bin/storage-cli.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/storage-cli.js b/bin/storage-cli.js index 9b01ec69..4ceac252 100755 --- a/bin/storage-cli.js +++ b/bin/storage-cli.js @@ -20,7 +20,7 @@ process.chdir( path.dirname( __dirname ) ); // load app's config file var config = require('../conf/config.json'); -// shift files off beginning of arg array +// shift commands off beginning of arg array var argv = JSON.parse( JSON.stringify(process.argv.slice(2)) ); var commands = []; while (argv.length && !argv[0].match(/^\-/)) { @@ -98,13 +98,13 @@ var storage = new StandaloneStorage(config.Storage, function(err) { // make sure this is only run once storage.get( 'global/users', function(err) { if (!err) { - print( "\nStorage has already been set up. There is no need to run this command again.\n\n" ); + print( "Storage has already been set up. There is no need to run this command again.\n\n" ); process.exit(1); } async.eachSeries( setup.storage, function(params, callback) { - print( "Executing: " + JSON.stringify(params) + "\n" ); + verbose( "Executing: " + JSON.stringify(params) + "\n" ); // [ "listCreate", "global/users", { "page_size": 100 } ] var func = params.shift(); params.push( callback ); @@ -124,7 +124,9 @@ var storage = new StandaloneStorage(config.Storage, function(err) { }, function(err) { if (err) throw err; - print( "\nSetup completed successfully!\n" ); + if (args.verbose) print("\n"); + + print( "Setup completed successfully!\n" ); print( "This server ("+hostname+") has been added as the single primary master server.\n" ); print( "An administrator account has been created with username 'admin' and password 'admin'.\n" ); print( "You should now be able to start the service by typing: '/opt/cronicle/bin/control.sh start'\n" );