parent
b181aff14e
commit
95885a8de2
1 changed files with 15 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
repositoryUrl=${1:-https://github.com/codecombat/codecombat.git}
|
repositoryUrl=${1:-https://github.com/codecombat/codecombat.git}
|
||||||
deps=( git python )
|
deps=( git python )
|
||||||
|
NODE_VERSION=v0.10
|
||||||
function checkDependencies { #usage: checkDependencies [name of dependency array] [name of error checking function]
|
function checkDependencies { #usage: checkDependencies [name of dependency array] [name of error checking function]
|
||||||
declare -a dependencyArray=("${!1}")
|
declare -a dependencyArray=("${!1}")
|
||||||
for i in "${dependencyArray[@]}"
|
for i in "${dependencyArray[@]}"
|
||||||
|
@ -23,14 +24,27 @@ function basicDependenciesErrorHandling {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkIsRoot {
|
function checkIsRoot {
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root (run 'sudo ./$me $installDirectory')" 1>&2
|
echo "This script must be run as root (run 'sudo ./$me $installDirectory')" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
#checkIsRoot
|
|
||||||
|
function checkNodeVersion {
|
||||||
|
#thanks https://gist.github.com/phatblat/1713458
|
||||||
|
node --version | grep ${NODE_VERSION}
|
||||||
|
if [[ $? != 0 ]] ; then
|
||||||
|
echo "Node was found, but not version 0.10. Make sure 0.10 is installed before running the install script."
|
||||||
|
echo "Also, make sure `sudo node -v` also returns v0.10.x."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
checkDependencies deps[@] basicDependenciesErrorHandling
|
checkDependencies deps[@] basicDependenciesErrorHandling
|
||||||
|
#check for node
|
||||||
|
checkNodeVersion
|
||||||
#install git repository
|
#install git repository
|
||||||
git clone $repositoryUrl coco
|
git clone $repositoryUrl coco
|
||||||
#python ./coco/scripts/devSetup/setup.py
|
#python ./coco/scripts/devSetup/setup.py
|
||||||
|
|
Reference in a new issue