diff --git a/README.md b/README.md index 646cf14..588b8f6 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Once you have that set up, you can install DBot's dependencies, configure and run the bot for the first time with the following command: ``` -sh install.sh +./install ``` ## Upgrading diff --git a/config.json.sample b/config.json.sample index ed18f7a..37d1253 100644 --- a/config.json.sample +++ b/config.json.sample @@ -19,6 +19,7 @@ "language": "en", "debugMode": false, "debugLevel": 1, + "redisPort": 6379, "repoRoot": "https://github.com/reality/depressionbot/", "version": "Depressionbot IRC bot 0.5-dev - Lovingly crafted by The DepressionBot Foundation (a charity arm of the Official Aberystwyth Open Source International Development League)." } diff --git a/install b/install new file mode 100755 index 0000000..57d20cf --- /dev/null +++ b/install @@ -0,0 +1,46 @@ +#!/bin/bash +cat LICENCE +git submodule init +git submodule update + +if [ ! -e /usr/bin/node ] && [ ! -e /usr/local/bin/node ]; +then + echo 'node.js is not installed. Please install it before running install.sh.' + exit 1 +fi +if [ ! -e /usr/bin/npm ] && [ ! -e /usr/local/bin/npm ]; +then + echo 'npm is not installed. Please install it before running install.sh' + exit 1 +fi + +npm install async wordnik node-uuid underscore request sandbox express moment-timezone moment jade databank databank-redis ent passport passport-local password-hash connect-flash + +cd public/ +wget http://twitter.github.com/bootstrap/assets/bootstrap.zip +unzip bootstrap.zip +rm bootstrap.zip + +mkdir d3 +cd d3 +wget http://d3js.org/d3.v3.zip +unzip d3.v3.zip +rm d3.v3.zip + +cd ../.. + +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 +