From 102318497db7cbdf22bd5be2ef3af497f92fbb9d Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 16 Feb 2012 08:54:53 -0500 Subject: [PATCH] Allow settings to be specified with short '-s' option --- bin/installDeps.sh | 1 + node/utils/Settings.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 6693a994f..a88af2a67 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -45,6 +45,7 @@ settings="settings.json" a=''; for arg in $*; do if [ "$a" = "--settings" ]; then settings=$arg; fi + if [ "$a" = "-s" ]; then settings=$arg; fi a=$arg done #Does a $settings exist? if no copy the template diff --git a/node/utils/Settings.js b/node/utils/Settings.js index 18832921e..38496afd1 100644 --- a/node/utils/Settings.js +++ b/node/utils/Settings.js @@ -22,7 +22,11 @@ var fs = require("fs"); var os = require("os"); var path = require('path'); -var argv = require('optimist').argv; + +/** + * Read in cli args + */ +exports.argv = require('optimist').argv; /** * The IP ep-lite should listen to @@ -90,7 +94,7 @@ exports.abiwordAvailable = function() } // Discover where the settings file lives -var settingsFilename = argv.settings || "settings.json"; +var settingsFilename = exports.argv.settings || exports.argv.s || "settings.json"; var settingsPath = settingsFilename.charAt(0) == '/' ? '' : path.normalize(__dirname + "/../../"); //read the settings sync