@@ -92,8 +92,8 @@ var platforms = {
92
92
"osx" : "OS X (Xcode)" ,
93
93
"vs" : "Windows (Visual Studio 2015)" ,
94
94
"ios" : "iOS (Xcode)" ,
95
- "linux" : "Linux 32-bit (Code::Blocks )" ,
96
- "linux64" : "Linux 64-bit (Code::Blocks )" ,
95
+ "linux" : "Linux 32-bit (qtCreator )" ,
96
+ "linux64" : "Linux 64-bit (qtCreator )" ,
97
97
"linuxarmv6l" : "Linux ARMv6 (Makefiles)" ,
98
98
"linuxarmv7l" : "Linux ARMv7 (Makefiles)"
99
99
} ;
@@ -301,9 +301,13 @@ function parseAddonsAndUpdateSelect(arg) {
301
301
//path = require('path').resolve(__dirname, defaultOfPath + "/addons");
302
302
addons = getDirectories ( arg + "/addons" , "ofx" ) ;
303
303
304
- addons = addons . filter ( function ( addon ) {
305
- return addonsToSkip . indexOf ( addon ) == - 1 ;
306
- } ) ;
304
+ if ( addons ) {
305
+ if ( addons . length > 0 ) {
306
+ addons = addons . filter ( function ( addon ) {
307
+ return addonsToSkip . indexOf ( addon ) == - 1 ;
308
+ } ) ;
309
+ }
310
+ }
307
311
308
312
console . log ( "Reloading the addons folder, these were found:" ) ;
309
313
console . log ( addons ) ;
@@ -571,15 +575,17 @@ ipc.on('update', function(event, arg) {
571
575
'<strong>Success!</strong><br>' +
572
576
'Updating your project was successful! <a href="file:///' + update [ 'updatePath' ] + '" class="monospace" data-toggle="external_target">' + update [ 'updatePath' ] + '</a><br><br>' +
573
577
'<button class="btn btn-default console-feature" onclick="$(\'#fullConsoleOutput\').toggle();">Show full log</button><br>' +
574
- '<div id="fullConsoleOutput"><br><textarea class="selectable">' + stdout + '</textarea></div>'
578
+ '<div id="fullConsoleOutput"><br><textarea class="selectable">' + stdout + '\n\n\n(command used:' + wholeString + ')\n\n\n </textarea></div>'
575
579
) ;
580
+
581
+ //
576
582
event . sender . send ( 'updateCompleted' , true ) ;
577
583
} else {
578
584
event . sender . send ( 'consoleMessage' , "<strong>" + wholeString + "</strong><br>" + error . message ) ;
579
585
event . sender . send ( 'sendUIMessage' ,
580
586
'<strong>Error...</strong><br>' +
581
587
'There was a problem updating your project... <span class="monospace">' + update [ 'updatePath' ] + '</span>' +
582
- '<div id="fullConsoleOutput" class="not-hidden"><br><textarea class="selectable">' + error . message + '</textarea></div>'
588
+ '<div id="fullConsoleOutput" class="not-hidden"><br><textarea class="selectable">' + error . message + '\n\n\n(command used:' + wholeString + ')\n\n\n </textarea></div>'
583
589
) ;
584
590
}
585
591
} ) ;
@@ -665,7 +671,7 @@ ipc.on('generate', function(event, arg) {
665
671
event . sender . send ( 'sendUIMessage' ,
666
672
'<strong>Success!</strong><br>' +
667
673
'Your can now find your project in <a href="file:///' + fullPath + '" data-toggle="external_target" class="monospace">' + fullPath + '</a><br><br>' +
668
- '<div id="fullConsoleOutput" class="not-hidden"><br><textarea class="selectable">' + stdout + '</textarea></div>'
674
+ '<div id="fullConsoleOutput" class="not-hidden"><br><textarea class="selectable">' + stdout + '\n\n\n(command used: ' + wholeString + ')\n\n\n </textarea></div>'
669
675
) ;
670
676
event . sender . send ( 'generateCompleted' , true ) ;
671
677
} else if ( error !== null ) {
@@ -684,7 +690,7 @@ ipc.on('generate', function(event, arg) {
684
690
'<strong>Error!</strong><br>' +
685
691
'<strong>Error...</strong><br>' +
686
692
'There was a problem generating your project... <span class="monospace">' + fullPath + '</span>' +
687
- '<div id="fullConsoleOutput" class="not-hidden"><br><textarea class="selectable">' + stdout + '</textarea></div>'
693
+ '<div id="fullConsoleOutput" class="not-hidden"><br><textarea class="selectable">' + stdout + '\n\n\n(command used: ' + wholeString + ')\n\n\n </textarea></div>'
688
694
689
695
) ;
690
696
@@ -770,6 +776,54 @@ ipc.on('pickProjectImport', function(event, arg) {
770
776
} ) ;
771
777
} ) ;
772
778
779
+
780
+ ipc . on ( 'launchProjectinIDE' , function ( event , arg ) {
781
+
782
+ if ( arg . platform != obj . defaultPlatform ) {
783
+ event . sender . send ( 'projectLaunchCompleted' , false ) ;
784
+ return ;
785
+ }
786
+
787
+ var pathTemp = require ( 'path' ) ;
788
+ var fsTemp = require ( 'fs' ) ;
789
+ var fullPath = pathTemp . join ( arg [ 'projectPath' ] , arg [ 'projectName' ] ) ;
790
+
791
+ if ( fsTemp . statSync ( fullPath ) . isDirectory ( ) == false ) {
792
+ // project doesn't exist
793
+ event . sender . send ( 'projectLaunchCompleted' , false ) ;
794
+ return ;
795
+ }
796
+
797
+ // // launch xcode
798
+ if ( arg . platform == 'osx' ) {
799
+ var osxPath = pathTemp . join ( fullPath , arg [ 'projectName' ] + '.xcodeproj' ) ;
800
+ console . log ( osxPath ) ;
801
+ if ( fsTemp . statSync ( osxPath ) . isDirectory ( ) == true ) { // note: .xcodeproj is a folder, not a file
802
+ var exec = require ( 'child_process' ) . exec ;
803
+ exec ( 'open ' + osxPath , function callback ( error , stdout , stderr ) {
804
+ return ;
805
+ } ) ;
806
+ }
807
+ else {
808
+ console . log ( 'OSX project file not found!' ) ;
809
+ }
810
+ } else if ( arg . platform == 'linux' || arg . platform == 'linux64' ) {
811
+ var linuxPath = pathTemp . join ( fullPath , arg [ 'projectName' ] + '.qbs' ) ;
812
+ console . log ( linuxPath ) ;
813
+ var exec = require ( 'child_process' ) . exec ;
814
+ exec ( 'xdg-open ' + linuxPath , function callback ( error , stdout , stderr ) {
815
+ return ;
816
+ } ) ;
817
+ } else {
818
+ var windowsPath = pathTemp . join ( fullPath , arg [ 'projectName' ] + '.sln' ) ;
819
+ console . log ( windowsPath ) ;
820
+ var exec = require ( 'child_process' ) . exec ;
821
+ exec ( 'start ' + windowsPath , function callback ( error , stdout , stderr ) {
822
+ return ;
823
+ } ) ;
824
+ }
825
+ } ) ;
826
+
773
827
ipc . on ( 'quit' , function ( event , arg ) {
774
828
app . quit ( ) ;
775
829
} ) ;
0 commit comments