From a130c3e744fd22231d52227374e984c30d13fd07 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 30 Jan 2013 14:57:36 +0000 Subject: [PATCH] Further automate the install script * config.json is now created in the correct location * config.json is only created if it doesn't already exist * vim launches to edit config.json on first install * User is prompted to run depressionbot directly from the script --- install.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 42cf7ec..8a8d85d 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/bin/bash - +cat LICENCE git submodule init git submodule update @@ -16,8 +16,20 @@ wget http://d3js.org/d3.v3.zip unzip d3.v3.zip rm d3.v3.zip -cd .. +cd ../.. -cp config.json.sample config.json +if [ ! -f config.json ]; +then + echo 'Creating configuration file...' + cp config.json.sample config.json + vim config.json +fi + +read -p "Setup complete. Run depressionbot now? [y/N]" +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + echo 'Okay. To run the bot, use "node run.js"' + exit +fi +node run.js -echo 'Setup complete. Now edit config.json with your preferences and run the bot with "node run.js"'