Fix launching text editor from a redbox stacktrace on windows
Summary: Launch the editor with cmd on windows. Closes https://github.com/facebook/react-native/pull/5238 Reviewed By: svcscm Differential Revision: D2819943 Pulled By: pcottle fb-gh-sync-id: a38f88bb9be72871cc3a37367973371176799d9e
This commit is contained in:
parent
05f31a0cbf
commit
e08a7f3587
|
@ -125,7 +125,13 @@ function launchEditor(fileName, lineNumber) {
|
|||
_childProcess.kill('SIGKILL');
|
||||
}
|
||||
|
||||
_childProcess = child_process.spawn(editor, args, {stdio: 'inherit'});
|
||||
if (process.platform === 'win32') {
|
||||
// On Windows, launch the editor in a shell because spawn can only
|
||||
// launch .exe files.
|
||||
_childProcess = child_process.spawn('cmd.exe', ['/C', editor].concat(args), {stdio: 'inherit'});
|
||||
} else {
|
||||
_childProcess = child_process.spawn(editor, args, {stdio: 'inherit'});
|
||||
}
|
||||
_childProcess.on('exit', function(errorCode) {
|
||||
_childProcess = null;
|
||||
|
||||
|
|
Loading…
Reference in New Issue