check node and npm version on install
This commit is contained in:
parent
39bc588ae7
commit
4b892ae4ff
|
@ -20,12 +20,26 @@ hash node > /dev/null 2>&1 || {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#check node version
|
||||||
|
NODE_VERSION=$(node --version)
|
||||||
|
if [ ! $(echo $NODE_VERSION | cut -d "." -f 1-2) = "v0.4" ]; then
|
||||||
|
echo "You're running a wrong version of node, you're using $NODE_VERSION, we need v0.4.x" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
#Is npm installed?
|
#Is npm installed?
|
||||||
hash npm > /dev/null 2>&1 || {
|
hash npm > /dev/null 2>&1 || {
|
||||||
echo "Please install npm ( http://npmjs.org )" >&2
|
echo "Please install npm ( http://npmjs.org )" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#check npm version
|
||||||
|
NPM_VERSION=$(npm --version)
|
||||||
|
if [ ! $(echo $NPM_VERSION | cut -d "." -f 1-2) = "1.0" ]; then
|
||||||
|
echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.0.x" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
#Does a settings.json exist? if no copy the template
|
#Does a settings.json exist? if no copy the template
|
||||||
if [ ! -f "settings.json" ]; then
|
if [ ! -f "settings.json" ]; then
|
||||||
echo "Copy the settings template to settings.json..."
|
echo "Copy the settings template to settings.json..."
|
||||||
|
|
Loading…
Reference in New Issue