Skip to content

Commit 4537783

Browse files
committed
adopt yarn in scripts
1 parent 5d4d385 commit 4537783

7 files changed

Lines changed: 7 additions & 39 deletions

File tree

scripts/code-cli.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title VSCode Dev
66
pushd %~dp0\..
77

88
:: Node modules
9-
if not exist node_modules call .\scripts\npm.bat install
9+
if not exist node_modules call yarn
1010

1111
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
1212
set NAMESHORT=%NAMESHORT: "=%

scripts/code-cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function code() {
2222
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
2323

2424
# Node modules
25-
test -d node_modules || ./scripts/npm.sh install
25+
test -d node_modules || yarn
2626

2727
# Get electron
2828
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron

scripts/code.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title VSCode Dev
66
pushd %~dp0\..
77

88
:: Node modules
9-
if not exist node_modules call .\scripts\npm.bat install
9+
if not exist node_modules call yarn
1010

1111
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
1212
set NAMESHORT=%NAMESHORT: "=%

scripts/code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function code() {
2222
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
2323

2424
# Node modules
25-
test -d node_modules || ./scripts/npm.sh install
25+
test -d node_modules || yarn
2626

2727
# Get electron
2828
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron

scripts/npm.bat

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
@echo off
2-
setlocal
3-
set npm_config_disturl="https://atom.io/download/electron"
4-
for /f "tokens=2 delims=:, " %%a in ('findstr /R /C:"\"electronVersion\":.*" "%~dp0..\package.json"') do set npm_config_target=%%~a
5-
set npm_config_runtime="electron"
6-
set npm_config_cache=~\.npm-electron
7-
npm %*
8-
endlocal
2+
yarn %*

scripts/npm.sh

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
11
#!/bin/bash
22

3-
if [[ "$OSTYPE" == "darwin"* ]]; then
4-
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
5-
ROOT=$(dirname "$(dirname "$(realpath "$0")")")
6-
npm_config_arch=x64
7-
else
8-
ROOT=$(dirname "$(dirname "$(readlink -f $0)")")
9-
10-
# if [ -z $npm_config_arch ]; then
11-
# npm_config_arch=$(node -p process.arch)
12-
# 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'."
13-
# fi
14-
fi
15-
16-
ELECTRON_VERSION=$(
17-
cat "$ROOT"/package.json |
18-
grep electronVersion |
19-
sed -e 's/[[:space:]]*"electronVersion":[[:space:]]*"\([0-9.]*\)"\(,\)*/\1/'
20-
)
21-
22-
ELECTRON_GYP_HOME=~/.electron-gyp
23-
mkdir -p $ELECTRON_GYP_HOME
24-
25-
npm_config_disturl=https://atom.io/download/electron \
26-
npm_config_target=$ELECTRON_VERSION \
27-
npm_config_runtime=electron \
28-
HOME=$ELECTRON_GYP_HOME \
29-
npm $*
3+
yarn $*

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
2222
INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null)
2323

2424
# Node modules
25-
test -d node_modules || ./scripts/npm.sh install
25+
test -d node_modules || yarn
2626

2727
# Get electron
2828
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron

0 commit comments

Comments
 (0)