提交 838ada36 编写于 作者: J Joao Moreno

make code launchers specific on the flavor

上级 b7a19b42
......@@ -10,15 +10,19 @@ fi
function code() {
cd $ROOT
if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameShort"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE=".build/electron/code-oss"
fi
# Node modules
test -d node_modules || ./scripts/npm.sh install
# Get electron
if [[ "$OSTYPE" == "darwin"* ]]; then
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
test -f "$CODE" || ./node_modules/.bin/gulp electron
# Build
test -d out || ./node_modules/.bin/gulp compile
......@@ -31,11 +35,7 @@ function code() {
export ELECTRON_ENABLE_STACK_DUMPING=1
# Launch Code
if [[ "$OSTYPE" == "darwin"* ]]; then
exec ./.build/electron/Code\ -\ OSS.app/Contents/MacOS/Electron . "$@"
else
exec ./.build/electron/code-oss . "$@"
fi
exec "$CODE" . "$@"
}
code "$@"
......@@ -9,7 +9,13 @@ if not "%BUILD_BUILDID%" == "" (
)
pushd %~dp0\..
.\.build\electron\code-oss-dev.exe .\node_modules\mocha\bin\_mocha %*
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
set NAMESHORT=%NAMESHORT: "=%
set NAMESHORT=%NAMESHORT:"=%.exe
set CODE=".build\electron\%NAMESHORT%"
%CODE% .\node_modules\mocha\bin\_mocha %*
popd
endlocal
......
......@@ -10,15 +10,19 @@ fi
cd $ROOT
if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameShort"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE=".build/electron/code-oss"
fi
# Node modules
test -d node_modules || ./scripts/npm.sh install
# Get electron
if [[ "$OSTYPE" == "darwin"* ]]; then
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
test -f "$CODE" || ./node_modules/.bin/gulp electron
# Build
test -d out || ./node_modules/.bin/gulp compile
......@@ -26,10 +30,10 @@ test -d out || ./node_modules/.bin/gulp compile
# Unit Tests
if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT ; ulimit -n 4096 ; ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 \
./.build/electron/Code\ -\ OSS.app/Contents/MacOS/Electron \
"$CODE" \
node_modules/mocha/bin/_mocha $*
else
cd $ROOT ; ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 \
./.build/electron/code-oss \
"$CODE" \
node_modules/mocha/bin/_mocha $*
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册