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

@ -10,32 +10,32 @@ fi
function code() { function code() {
cd $ROOT cd $ROOT
if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
else
NAME=`node -p "require('./product.json').applicationName"`
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 # Node modules
test -d node_modules || ./scripts/npm.sh install test -d node_modules || ./scripts/npm.sh install
# Get electron # Get electron
if [[ "$OSTYPE" == "darwin"* ]]; then (test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
test -d .build/electron/Code\ -\ OSS.app || ./node_modules/.bin/gulp electron
else
test -d .build/electron/code-oss || ./node_modules/.bin/gulp electron
fi
# Build # Build
test -d out || ./node_modules/.bin/gulp compile test -d out || ./node_modules/.bin/gulp compile
# Launch Code
[[ "$OSTYPE" == "darwin"* ]] \
&& ELECTRON=.build/electron/Code\ -\ OSS.app/Contents/MacOS/Electron \
|| ELECTRON=.build/electron/code-oss
CLI="$ROOT/out/cli.js"
ELECTRON_RUN_AS_NODE=1 \ ELECTRON_RUN_AS_NODE=1 \
NODE_ENV=development \ NODE_ENV=development \
VSCODE_DEV=1 \ VSCODE_DEV=1 \
ELECTRON_ENABLE_LOGGING=1 \ ELECTRON_ENABLE_LOGGING=1 \
ELECTRON_ENABLE_STACK_DUMPING=1 \ ELECTRON_ENABLE_STACK_DUMPING=1 \
"$ELECTRON" --debug=5874 "$CLI" . "$@" "$CODE" --debug=5874 "$ROOT/out/cli.js" . "$@"
} }
code "$@" code "$@"

View file

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

View file

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