Skip to content

Commit

Permalink
use ELECTRON_RUN_AS_NODE
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Feb 12, 2016
1 parent c0b72c1 commit 4821ad5
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
environment:
ATOM_SHELL_INTERNAL_RUN_AS_NODE: 1
ELECTRON_RUN_AS_NODE: 1

install:
- ps: Install-Product node 4.1.1 x64
Expand Down
2 changes: 1 addition & 1 deletion extensions/typescript/src/utils/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function generatePatchedEnv(env:any, stdInPipeName:string, stdOutPipeName:string

newEnv['STDIN_PIPE_NAME'] = stdInPipeName;
newEnv['STDOUT_PIPE_NAME'] = stdOutPipeName;
newEnv['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = '1';
newEnv['ELECTRON_RUN_AS_NODE'] = '1';

return newEnv;
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/typescript/src/utils/electronForkStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var stdOutPipeName = process.env['STDOUT_PIPE_NAME'];

log('STDIN_PIPE_NAME: ' + stdInPipeName);
log('STDOUT_PIPE_NAME: ' + stdOutPipeName);
log('ATOM_SHELL_INTERNAL_RUN_AS_NODE: ' + process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE']);
log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']);

// stdout redirection to named pipe
(function() {
Expand Down Expand Up @@ -136,7 +136,7 @@ log('ATOM_SHELL_INTERNAL_RUN_AS_NODE: ' + process.env['ATOM_SHELL_INTERNAL_RUN_A
// Unset the custom environmental variables that should not get inherited
delete process.env['STDIN_PIPE_NAME'];
delete process.env['STDOUT_PIPE_NAME'];
delete process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'];
delete process.env['ELECTRON_RUN_AS_NODE'];

require(program);

Expand Down
2 changes: 1 addition & 1 deletion resources/common/bin/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ fi

VSCODE_LAUNCHER="$VSCODE_DIR/resources/app/out/cli.js"

ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 VSCODE_PATH="$VSCODE_DIR/$ELECTRON_FILE" \
ELECTRON_RUN_AS_NODE=1 VSCODE_PATH="$VSCODE_DIR/$ELECTRON_FILE" \
"$VSCODE_DIR/$ELECTRON_FILE" $VSCODE_LAUNCHER "$@"
exit $?
2 changes: 1 addition & 1 deletion resources/win32/bin/code.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
setlocal
set VSCODE_DEV=
set ATOM_SHELL_INTERNAL_RUN_AS_NODE=1
set ELECTRON_RUN_AS_NODE=1
"%~dp0..\\Code.exe" "%~dp0code.js" %*
endlocal
2 changes: 1 addition & 1 deletion resources/win32/bin/code.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
delete process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'];
delete process.env['ELECTRON_RUN_AS_NODE'];
require('child_process').spawn(require('path').resolve(__dirname, '..', 'Code.exe'), process.argv.slice(2), { detached: true, stdio: 'ignore' });
process.exit(0);
2 changes: 1 addition & 1 deletion scripts/test.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off

set ATOM_SHELL_INTERNAL_RUN_AS_NODE=1
set ELECTRON_RUN_AS_NODE=1

pushd %~dp0\..
.\.build\electron\electron.exe .\node_modules\mocha\bin\_mocha %*
Expand Down
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ fi

# Unit Tests
if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT ; ulimit -n 4096 ; ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 \
cd $ROOT ; ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
./.build/electron/Electron.app/Contents/MacOS/Electron \
node_modules/mocha/bin/_mocha $*
else
cd $ROOT ; ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 \
cd $ROOT ; ELECTRON_RUN_AS_NODE=1 \
./.build/electron/electron \
node_modules/mocha/bin/_mocha $*
fi
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/node/stdFork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function generatePatchedEnv(env:any, stdInPipeName:string, stdOutPipeName:string

newEnv['STDIN_PIPE_NAME'] = stdInPipeName;
newEnv['STDOUT_PIPE_NAME'] = stdOutPipeName;
newEnv['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = '1';
newEnv['ELECTRON_RUN_AS_NODE'] = '1';

return newEnv;
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/base/node/stdForkStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var stdOutPipeName = process.env['STDOUT_PIPE_NAME'];

log('STDIN_PIPE_NAME: ' + stdInPipeName);
log('STDOUT_PIPE_NAME: ' + stdOutPipeName);
log('ATOM_SHELL_INTERNAL_RUN_AS_NODE: ' + process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE']);
log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']);

// stdout redirection to named pipe
(function() {
Expand Down Expand Up @@ -136,7 +136,7 @@ log('ATOM_SHELL_INTERNAL_RUN_AS_NODE: ' + process.env['ATOM_SHELL_INTERNAL_RUN_A
// Unset the custom environmental variables that should not get inherited
delete process.env['STDIN_PIPE_NAME'];
delete process.env['STDOUT_PIPE_NAME'];
delete process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'];
delete process.env['ELECTRON_RUN_AS_NODE'];

require(program);

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/electron-main/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function main(argv: string[]) {
} else if (argParser.hasFlag('version', 'v')) {
console.log(packageJson.version);
} else {
delete process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'];
delete process.env['ELECTRON_RUN_AS_NODE'];
spawn(process.env['VSCODE_PATH'], process.argv.slice(2), { detached: true, stdio: 'ignore' });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function createNativeRawGitService(workspaceRoot: string, gitPath: string
timeout: 1000 * 60,
args: [gitPath, workspaceRoot, defaultEncoding, remote.process.execPath],
env: {
ATOM_SHELL_INTERNAL_RUN_AS_NODE: 1,
ELECTRON_RUN_AS_NODE: 1,
AMD_ENTRYPOINT: 'vs/workbench/parts/git/electron-browser/gitApp'
}
}
Expand Down

0 comments on commit 4821ad5

Please sign in to comment.