From 62b01f960ee9442318d646ec09c3d4a54cc43e71 Mon Sep 17 00:00:00 2001 From: zach lieberman Date: Sat, 7 Nov 2015 16:08:39 -0500 Subject: [PATCH 1/4] fix for windows spaces, needs testing --- projectGeneratorElectron/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/projectGeneratorElectron/index.js b/projectGeneratorElectron/index.js index 78dbec3b..c9ea16aa 100644 --- a/projectGeneratorElectron/index.js +++ b/projectGeneratorElectron/index.js @@ -564,8 +564,12 @@ ipc.on('update', function(event, arg) { var pgApp = pathTemp.normalize(pathTemp.join(pathTemp.join(__dirname, "app"), "projectGenerator")); - pgApp = pgApp.replace(/ /g, '\\ '); - + if( arg.platform == 'osx' || arg.platform == 'linux' || arg.platform == 'linux64' ){ + pgApp = pgApp.replace(/ /g, '\\ '); + } else { + pgApp = pgApp.replace(/ /g, '^ '); + } + var wholeString = pgApp + " " + recursiveString + " " + verboseString + " " + pathString + " " + platformString + " " + updatePath; exec(wholeString, function callback(error, stdout, stderr) { @@ -646,7 +650,11 @@ ipc.on('generate', function(event, arg) { pgApp = pathTemp.normalize(pathTemp.join(pathTemp.join(__dirname, "app"), "projectGenerator")); } - pgApp = pgApp.replace(/ /g, '\\ '); + if( arg.platform == 'osx' || arg.platform == 'linux' || arg.platform == 'linux64' ){ + pgApp = pgApp.replace(/ /g, '\\ '); + } else { + pgApp = pgApp.replace(/ /g, '^ '); + } var wholeString = pgApp + " " + verboseString + " " + pathString + " " + addonString + " " + platformString + " " + projectString; From f0c7cf2cbf4b9eaa8e34068a41b0183ef2a80db8 Mon Sep 17 00:00:00 2001 From: zach lieberman Date: Sat, 7 Nov 2015 17:32:52 -0500 Subject: [PATCH 2/4] more fixes for spaces --- projectGeneratorElectron/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projectGeneratorElectron/index.js b/projectGeneratorElectron/index.js index c9ea16aa..6277f452 100644 --- a/projectGeneratorElectron/index.js +++ b/projectGeneratorElectron/index.js @@ -567,7 +567,7 @@ ipc.on('update', function(event, arg) { if( arg.platform == 'osx' || arg.platform == 'linux' || arg.platform == 'linux64' ){ pgApp = pgApp.replace(/ /g, '\\ '); } else { - pgApp = pgApp.replace(/ /g, '^ '); + pgApp = "\"" + pgApp + "\""; } var wholeString = pgApp + " " + recursiveString + " " + verboseString + " " + pathString + " " + platformString + " " + updatePath; @@ -653,7 +653,7 @@ ipc.on('generate', function(event, arg) { if( arg.platform == 'osx' || arg.platform == 'linux' || arg.platform == 'linux64' ){ pgApp = pgApp.replace(/ /g, '\\ '); } else { - pgApp = pgApp.replace(/ /g, '^ '); + pgApp = pgApp = "\"" + pgApp + "\""; } var wholeString = pgApp + " " + verboseString + " " + pathString + " " + addonString + " " + platformString + " " + projectString; @@ -807,6 +807,7 @@ ipc.on('launchProjectinIDE', function(event, arg) { if( arg.platform == 'osx' ){ var osxPath = pathTemp.join(fullPath, arg['projectName'] + '.xcodeproj'); console.log( osxPath ); + osxPath = osxPath.replace(/ /g, '\\ '); if( fsTemp.statSync(osxPath).isDirectory() == true ){ // note: .xcodeproj is a folder, not a file var exec = require('child_process').exec; exec('open ' + osxPath, function callback(error, stdout, stderr){ @@ -818,6 +819,7 @@ ipc.on('launchProjectinIDE', function(event, arg) { } } else if( arg.platform == 'linux' || arg.platform == 'linux64' ){ var linuxPath = pathTemp.join(fullPath, arg['projectName'] + '.qbs'); + linuxPath = linuxPath.replace(/ /g, '\\ '); console.log( linuxPath ); var exec = require('child_process').exec; exec('xdg-open ' + linuxPath, function callback(error, stdout, stderr){ @@ -826,6 +828,7 @@ ipc.on('launchProjectinIDE', function(event, arg) { } else { var windowsPath = pathTemp.join(fullPath, arg['projectName'] + '.sln'); console.log( windowsPath ); + windowsPath = "\"" + windowsPath + "\""; var exec = require('child_process').exec; exec('start ' + windowsPath, function callback(error, stdout, stderr){ return; From b6d28cb2d7c5c35d1780a3dc7ceaaabc1c0fa6b7 Mon Sep 17 00:00:00 2001 From: zach lieberman Date: Sat, 7 Nov 2015 17:43:51 -0500 Subject: [PATCH 3/4] start working with quotes --- projectGeneratorElectron/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projectGeneratorElectron/index.js b/projectGeneratorElectron/index.js index 6277f452..1a896362 100644 --- a/projectGeneratorElectron/index.js +++ b/projectGeneratorElectron/index.js @@ -830,7 +830,7 @@ ipc.on('launchProjectinIDE', function(event, arg) { console.log( windowsPath ); windowsPath = "\"" + windowsPath + "\""; var exec = require('child_process').exec; - exec('start ' + windowsPath, function callback(error, stdout, stderr){ + exec('start ' + "\"\"" + " " + windowsPath, function callback(error, stdout, stderr){ return; }); } From 51986b76e62e87ce928acb619c19b272867ba8e5 Mon Sep 17 00:00:00 2001 From: zach lieberman Date: Sun, 8 Nov 2015 06:44:43 -0500 Subject: [PATCH 4/4] spaces working on osx now for open in ide --- projectGeneratorElectron/index.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/projectGeneratorElectron/index.js b/projectGeneratorElectron/index.js index 1a896362..6c22c014 100644 --- a/projectGeneratorElectron/index.js +++ b/projectGeneratorElectron/index.js @@ -807,16 +807,11 @@ ipc.on('launchProjectinIDE', function(event, arg) { if( arg.platform == 'osx' ){ var osxPath = pathTemp.join(fullPath, arg['projectName'] + '.xcodeproj'); console.log( osxPath ); - osxPath = osxPath.replace(/ /g, '\\ '); - if( fsTemp.statSync(osxPath).isDirectory() == true ){ // note: .xcodeproj is a folder, not a file - var exec = require('child_process').exec; - exec('open ' + osxPath, function callback(error, stdout, stderr){ - return; - }); - } - else { - console.log('OSX project file not found!'); - } + osxPath = "\"" + osxPath + "\""; + var exec = require('child_process').exec; + exec('open ' + osxPath, function callback(error, stdout, stderr){ + return; + }); } else if( arg.platform == 'linux' || arg.platform == 'linux64' ){ var linuxPath = pathTemp.join(fullPath, arg['projectName'] + '.qbs'); linuxPath = linuxPath.replace(/ /g, '\\ ');