提交 45377837 编写于 作者: J Joao Moreno

adopt yarn in scripts

上级 5d4d3854
......@@ -6,7 +6,7 @@ title VSCode Dev
pushd %~dp0\..
:: Node modules
if not exist node_modules call .\scripts\npm.bat install
if not exist node_modules call yarn
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
set NAMESHORT=%NAMESHORT: "=%
......
......@@ -22,7 +22,7 @@ function code() {
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
# Node modules
test -d node_modules || ./scripts/npm.sh install
test -d node_modules || yarn
# Get electron
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
......
......@@ -6,7 +6,7 @@ title VSCode Dev
pushd %~dp0\..
:: Node modules
if not exist node_modules call .\scripts\npm.bat install
if not exist node_modules call yarn
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
set NAMESHORT=%NAMESHORT: "=%
......
......@@ -22,7 +22,7 @@ function code() {
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
# Node modules
test -d node_modules || ./scripts/npm.sh install
test -d node_modules || yarn
# Get electron
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
......
@echo off
setlocal
set npm_config_disturl="https://atom.io/download/electron"
for /f "tokens=2 delims=:, " %%a in ('findstr /R /C:"\"electronVersion\":.*" "%~dp0..\package.json"') do set npm_config_target=%%~a
set npm_config_runtime="electron"
set npm_config_cache=~\.npm-electron
npm %*
endlocal
yarn %*
#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname "$(dirname "$(realpath "$0")")")
npm_config_arch=x64
else
ROOT=$(dirname "$(dirname "$(readlink -f $0)")")
# if [ -z $npm_config_arch ]; then
# npm_config_arch=$(node -p process.arch)
# echo "Warning: remember to set \$npm_config_arch to either x64 or ia32 to build the binaries for the right architecture. Picking '$npm_config_arch'."
# fi
fi
ELECTRON_VERSION=$(
cat "$ROOT"/package.json |
grep electronVersion |
sed -e 's/[[:space:]]*"electronVersion":[[:space:]]*"\([0-9.]*\)"\(,\)*/\1/'
)
ELECTRON_GYP_HOME=~/.electron-gyp
mkdir -p $ELECTRON_GYP_HOME
npm_config_disturl=https://atom.io/download/electron \
npm_config_target=$ELECTRON_VERSION \
npm_config_runtime=electron \
HOME=$ELECTRON_GYP_HOME \
npm $*
\ No newline at end of file
yarn $*
\ No newline at end of file
......@@ -22,7 +22,7 @@ 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
test -d node_modules || yarn
# Get electron
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册