Debugger won't start due to spaces in directory path

Summary:
Similar issue to #214. When I attempt to do command + D in the simulator, I get the following issue.

```
Launching Dev Tools...
Failed to run launchChromeDevTools.applescript { [Error: Command failed: /bin/sh -c /Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packager/launchChromeDevTools.applescript http://localhost:8081/debugger-ui
/bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packager/launchChromeDevTools.applescript http://localhost:8081/debugger-ui'
]
  killed: false,
  code: 2,
  signal: null,
  cmd: '/bin/sh -c /Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packager/launchChromeDevTools.applescript http://localhost:8081/debugger-ui' }

/bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packa
Closes https://github.com/facebook/react-native/pull/348
Github Author: rickyc <rickyc.us@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
rickyc 2015-06-02 15:14:25 -07:00
parent 4d4f2dfe09
commit 78f83acdc2
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
var fs = require('fs'); var fs = require('fs');
var path = require('path'); var path = require('path');
var exec = require('child_process').exec; var execFile = require('child_process').execFile;
var http = require('http'); var http = require('http');
var getFlowTypeCheckMiddleware = require('./getFlowTypeCheckMiddleware'); var getFlowTypeCheckMiddleware = require('./getFlowTypeCheckMiddleware');
@ -172,7 +172,7 @@ function getDevToolsLauncher(options) {
var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui'; var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui';
var script = 'launchChromeDevTools.applescript'; var script = 'launchChromeDevTools.applescript';
console.log('Launching Dev Tools...'); console.log('Launching Dev Tools...');
exec(path.join(__dirname, script) + ' ' + debuggerURL, function(err, stdout, stderr) { execFile(path.join(__dirname, script), [debuggerURL], function(err, stdout, stderr) {
if (err) { if (err) {
console.log('Failed to run ' + script, err); console.log('Failed to run ' + script, err);
} }