check electron version in code.sh: osx linux

#15553
This commit is contained in:
Joao Moreno
2016-11-17 10:16:01 +01:00
parent 0633a0449f
commit 6796c10fe5
3 changed files with 21 additions and 15 deletions

View File

@@ -18,11 +18,14 @@ function code() {
CODE=".build/electron/$NAME"
fi
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
# Node modules
test -d node_modules || ./scripts/npm.sh install
# Get electron
test -f "$CODE" || ./node_modules/.bin/gulp electron
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
# Build
test -d out || ./node_modules/.bin/gulp compile