@@ -564,8 +564,12 @@ ipc.on('update', function(event, arg) {
564
564
var pgApp = pathTemp . normalize ( pathTemp . join ( pathTemp . join ( __dirname , "app" ) , "projectGenerator" ) ) ;
565
565
566
566
567
- pgApp = pgApp . replace ( / / g, '\\ ' ) ;
568
-
567
+ if ( arg . platform == 'osx' || arg . platform == 'linux' || arg . platform == 'linux64' ) {
568
+ pgApp = pgApp . replace ( / / g, '\\ ' ) ;
569
+ } else {
570
+ pgApp = "\"" + pgApp + "\"" ;
571
+ }
572
+
569
573
var wholeString = pgApp + " " + recursiveString + " " + verboseString + " " + pathString + " " + platformString + " " + updatePath ;
570
574
571
575
exec ( wholeString , function callback ( error , stdout , stderr ) {
@@ -646,7 +650,11 @@ ipc.on('generate', function(event, arg) {
646
650
pgApp = pathTemp . normalize ( pathTemp . join ( pathTemp . join ( __dirname , "app" ) , "projectGenerator" ) ) ;
647
651
}
648
652
649
- pgApp = pgApp . replace ( / / g, '\\ ' ) ;
653
+ if ( arg . platform == 'osx' || arg . platform == 'linux' || arg . platform == 'linux64' ) {
654
+ pgApp = pgApp . replace ( / / g, '\\ ' ) ;
655
+ } else {
656
+ pgApp = pgApp = "\"" + pgApp + "\"" ;
657
+ }
650
658
651
659
var wholeString = pgApp + " " + verboseString + " " + pathString + " " + addonString + " " + platformString + " " + projectString ;
652
660
@@ -799,17 +807,14 @@ ipc.on('launchProjectinIDE', function(event, arg) {
799
807
if ( arg . platform == 'osx' ) {
800
808
var osxPath = pathTemp . join ( fullPath , arg [ 'projectName' ] + '.xcodeproj' ) ;
801
809
console . log ( osxPath ) ;
802
- if ( fsTemp . statSync ( osxPath ) . isDirectory ( ) == true ) { // note: .xcodeproj is a folder, not a file
803
- var exec = require ( 'child_process' ) . exec ;
804
- exec ( 'open ' + osxPath , function callback ( error , stdout , stderr ) {
805
- return ;
806
- } ) ;
807
- }
808
- else {
809
- console . log ( 'OSX project file not found!' ) ;
810
- }
810
+ osxPath = "\"" + osxPath + "\"" ;
811
+ var exec = require ( 'child_process' ) . exec ;
812
+ exec ( 'open ' + osxPath , function callback ( error , stdout , stderr ) {
813
+ return ;
814
+ } ) ;
811
815
} else if ( arg . platform == 'linux' || arg . platform == 'linux64' ) {
812
816
var linuxPath = pathTemp . join ( fullPath , arg [ 'projectName' ] + '.qbs' ) ;
817
+ linuxPath = linuxPath . replace ( / / g, '\\ ' ) ;
813
818
console . log ( linuxPath ) ;
814
819
var exec = require ( 'child_process' ) . exec ;
815
820
exec ( 'xdg-open ' + linuxPath , function callback ( error , stdout , stderr ) {
@@ -818,8 +823,9 @@ ipc.on('launchProjectinIDE', function(event, arg) {
818
823
} else {
819
824
var windowsPath = pathTemp . join ( fullPath , arg [ 'projectName' ] + '.sln' ) ;
820
825
console . log ( windowsPath ) ;
826
+ windowsPath = "\"" + windowsPath + "\"" ;
821
827
var exec = require ( 'child_process' ) . exec ;
822
- exec ( 'start ' + windowsPath , function callback ( error , stdout , stderr ) {
828
+ exec ( 'start ' + "\"\"" + " " + windowsPath , function callback ( error , stdout , stderr ) {
823
829
return ;
824
830
} ) ;
825
831
}
0 commit comments