adopt yarn in scripts

This commit is contained in:
Joao Moreno 2017-11-16 10:47:02 +01:00
parent 5d4d38543a
commit 4537783742
7 changed files with 7 additions and 39 deletions

View file

@ -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: "=%

View file

@ -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

View file

@ -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: "=%

View file

@ -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

View file

@ -1,8 +1,2 @@
@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 %*

View file

@ -1,29 +1,3 @@
#!/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 $*
yarn $*

View 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