Skip to content

Commit

Permalink
only call yarn gulp node when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Jan 21, 2022
1 parent 3640c1a commit d46ed36
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
10 changes: 7 additions & 3 deletions scripts/code-server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ set VSCODE_DEV=1
:: Sync built-in extensions
call yarn download-builtin-extensions

:: Download nodejs executable for remote
call yarn gulp node
:: Node executable
FOR /F "tokens=*" %%g IN ('node build/lib/node.js') do (SET NODE=%%g)

if not exist "%NODE%" (
:: Download nodejs executable for remote
call yarn gulp node
)

:: Launch Server
FOR /F "tokens=*" %%g IN ('node build/lib/node.js') do (SET NODE=%%g)
call "%NODE%" scripts\code-server.js %*

popd
Expand Down
1 change: 1 addition & 0 deletions scripts/code-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (args.help) {
'./scripts/code-server.sh|bat [options]\n' +
' --launch Opens a browser'
);
// more help options will be printed by startServer
}

const serverArgs = process.argv.slice(2).filter(v => v !== '--launch');
Expand Down
7 changes: 4 additions & 3 deletions scripts/code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ function code() {
# Sync built-in extensions
yarn download-builtin-extensions

# Load remote node
yarn gulp node

NODE=$(node build/lib/node.js)
if [ ! -e $NODE ];then
# Load remote node
yarn gulp node
fi

NODE_ENV=development \
VSCODE_DEV=1 \
Expand Down
10 changes: 7 additions & 3 deletions scripts/code-web.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ pushd %~dp0\..
:: Sync built-in extensions
call yarn download-builtin-extensions

:: Download nodejs executable for remote
call yarn gulp node
:: Node executable
FOR /F "tokens=*" %%g IN ('node build/lib/node.js') do (SET NODE=%%g)

if not exist "%NODE%" (
:: Download nodejs executable for remote
call yarn gulp node
)

:: Launch Server
FOR /F "tokens=*" %%g IN ('node build/lib/node.js') do (SET NODE=%%g)
call "%NODE%" scripts\code-web.js %*

popd
Expand Down
7 changes: 5 additions & 2 deletions scripts/code-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ function code() {
# Sync built-in extensions
yarn download-builtin-extensions

# Load remote node
yarn gulp node
NODE=$(node build/lib/node.js)
if [ ! -e $NODE ];then
# Load remote node
yarn gulp node
fi

NODE=$(node build/lib/node.js)

Expand Down

0 comments on commit d46ed36

Please sign in to comment.