From 78f83acdc272cd70ec1af1b37f6d48b28045cc8f Mon Sep 17 00:00:00 2001 From: rickyc Date: Tue, 2 Jun 2015 15:14:25 -0700 Subject: [PATCH] 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 Test Plan: Imported from GitHub, without a `Test Plan:` line. --- packager/packager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packager/packager.js b/packager/packager.js index d630d06e385d30..7c4be0a779cbbe 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -10,7 +10,7 @@ var fs = require('fs'); var path = require('path'); -var exec = require('child_process').exec; +var execFile = require('child_process').execFile; var http = require('http'); var getFlowTypeCheckMiddleware = require('./getFlowTypeCheckMiddleware'); @@ -172,7 +172,7 @@ function getDevToolsLauncher(options) { var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui'; var script = 'launchChromeDevTools.applescript'; 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) { console.log('Failed to run ' + script, err); }