@@ -92,8 +92,8 @@ var platforms = {
9292 "osx" : "OS X (Xcode)" ,
9393 "vs" : "Windows (Visual Studio 2015)" ,
9494 "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 )" ,
9797 "linuxarmv6l" : "Linux ARMv6 (Makefiles)" ,
9898 "linuxarmv7l" : "Linux ARMv7 (Makefiles)"
9999} ;
@@ -301,9 +301,13 @@ function parseAddonsAndUpdateSelect(arg) {
301301 //path = require('path').resolve(__dirname, defaultOfPath + "/addons");
302302 addons = getDirectories ( arg + "/addons" , "ofx" ) ;
303303
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+ }
307311
308312 console . log ( "Reloading the addons folder, these were found:" ) ;
309313 console . log ( addons ) ;
@@ -571,15 +575,17 @@ ipc.on('update', function(event, arg) {
571575 '<strong>Success!</strong><br>' +
572576 'Updating your project was successful! <a href="file:///' + update [ 'updatePath' ] + '" class="monospace" data-toggle="external_target">' + update [ 'updatePath' ] + '</a><br><br>' +
573577 '<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>'
575579 ) ;
580+
581+ //
576582 event . sender . send ( 'updateCompleted' , true ) ;
577583 } else {
578584 event . sender . send ( 'consoleMessage' , "<strong>" + wholeString + "</strong><br>" + error . message ) ;
579585 event . sender . send ( 'sendUIMessage' ,
580586 '<strong>Error...</strong><br>' +
581587 '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>'
583589 ) ;
584590 }
585591 } ) ;
@@ -665,7 +671,7 @@ ipc.on('generate', function(event, arg) {
665671 event . sender . send ( 'sendUIMessage' ,
666672 '<strong>Success!</strong><br>' +
667673 '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>'
669675 ) ;
670676 event . sender . send ( 'generateCompleted' , true ) ;
671677 } else if ( error !== null ) {
@@ -684,7 +690,7 @@ ipc.on('generate', function(event, arg) {
684690 '<strong>Error!</strong><br>' +
685691 '<strong>Error...</strong><br>' +
686692 '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>'
688694
689695 ) ;
690696
@@ -770,6 +776,54 @@ ipc.on('pickProjectImport', function(event, arg) {
770776 } ) ;
771777} ) ;
772778
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+
773827ipc . on ( 'quit' , function ( event , arg ) {
774828 app . quit ( ) ;
775829} ) ;
0 commit comments