File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,20 +8,19 @@ set ORIGINAL_CP=%ORIGINAL_CP: =%
88rem Set code page to UTF-8
99chcp 65001 > nul
1010
11- set ELECTRON_EXECUTABLE = %~dp0 ..\..\Studio .exe
11+ set BUNDLED_NODE_EXECUTABLE = %~dp0 node .exe
1212set CLI_SCRIPT = %~dp0 ..\cli\main.js
1313
1414rem Prevent node from printing warnings about NODE_OPTIONS being ignored
1515set NODE_OPTIONS =
1616
17- if exist " %ELECTRON_EXECUTABLE% " (
18- set ELECTRON_RUN_AS_NODE = 1
19- call " %ELECTRON_EXECUTABLE% " " %CLI_SCRIPT% " %*
17+ if exist " %BUNDLED_NODE_EXECUTABLE% " (
18+ call " %BUNDLED_NODE_EXECUTABLE% " " %CLI_SCRIPT% " %*
2019) else (
21- if not exist " %CLI_SCRIPT% " (
22- set CLI_SCRIPT = %~dp0 ..\dist\cli\main.js
23- )
24- call node " %CLI_SCRIPT% " %*
20+ if not exist " %CLI_SCRIPT% " (
21+ set CLI_SCRIPT = %~dp0 ..\dist\cli\main.js
22+ )
23+ call node " %CLI_SCRIPT% " %*
2524)
2625
2726rem Restore original code page
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # The default assumption is that this script lives in `/Applications/Studio.app/Contents/Resources/bin/studio-cli.sh`
4- CONTENTS_DIR=$( dirname " $( dirname " $( dirname " $( realpath " $0 " ) " ) " ) " )
5- ELECTRON_EXECUTABLE=" $CONTENTS_DIR /MacOS/Studio"
3+ # The assumption is that this script lives in `/Applications/Studio.app/Contents/Resources/bin/studio-cli.sh`
4+ BIN_DIR=$( dirname " $( realpath " $0 " ) " )
5+ BUNDLED_NODE_EXECUTABLE=" $BIN_DIR /node"
6+ CONTENTS_DIR=$( dirname " $( dirname " $BIN_DIR " ) " )
67CLI_SCRIPT=" $CONTENTS_DIR /Resources/cli/main.js"
78
8- if [ -x " $ELECTRON_EXECUTABLE " ]; then
9+ if [ -x " $BUNDLED_NODE_EXECUTABLE " ]; then
910 # Prevent node from printing warnings about NODE_OPTIONS being ignored
1011 unset NODE_OPTIONS
11- ELECTRON_RUN_AS_NODE=1 exec " $ELECTRON_EXECUTABLE " " $CLI_SCRIPT " " $@ "
12+ exec " $BUNDLED_NODE_EXECUTABLE " " $CLI_SCRIPT " " $@ "
1213else
1314 # If the default script path is not found, assume that this script lives in the development directory
1415 # and look for the CLI JS bundle in the `./dist` directory
1516 if ! [ -f " $CLI_SCRIPT " ]; then
16- SCRIPT_DIR=$( dirname $( dirname " $( realpath " $0 " ) " ) )
17+ SCRIPT_DIR=$( dirname " $( dirname " $( realpath " $0 " ) " ) " )
1718 CLI_SCRIPT=" $SCRIPT_DIR /dist/cli/main.js"
1819 fi
1920
You can’t perform that action at this time.
0 commit comments