Skip to content

Commit 5f9f625

Browse files
ofTheoarturoc
authored andcommitted
fix for linux not finding pg binary. closes #209 (#227)
1 parent 0e6823f commit 5f9f625

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

frontend/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ ipc.on('update', function(event, arg) {
652652
var templateString = "";
653653
var recursiveString = "";
654654
var verboseString = "";
655+
var rootPath = defaultOfPath;
655656

656657
if (update['updatePath'] !== null) {
657658
updatePath = update['updatePath'];
@@ -668,6 +669,7 @@ ipc.on('update', function(event, arg) {
668669

669670
if (update['ofPath'] !== null) {
670671
pathString = "-o\"" + update['ofPath'] + "\"";
672+
rootPath = update['ofPath'];
671673
}
672674

673675
if (update['updateRecursive'] === true) {
@@ -679,7 +681,10 @@ ipc.on('update', function(event, arg) {
679681
}
680682

681683
var pgApp = pathTemp.normalize(pathTemp.join(pathTemp.join(__dirname, "app"), "projectGenerator"));
682-
684+
685+
if( hostplatform == "linux" || hostplatform == "linux64" ){
686+
pgApp = pathTemp.join(rootPath, "apps/projectGenerator/commandLine/bin/projectGenerator");
687+
}
683688

684689
if( arg.platform == 'osx' || arg.platform == 'linux' || arg.platform == 'linux64' ){
685690
pgApp = pgApp.replace(/ /g, '\\ ');
@@ -734,7 +739,7 @@ ipc.on('generate', function(event, arg) {
734739
var platformString = "";
735740
var templateString = "";
736741
var verboseString = "";
737-
742+
var rootPath = defaultOfPath;
738743

739744

740745
if (generate['platformList'] !== null) {
@@ -754,6 +759,7 @@ ipc.on('generate', function(event, arg) {
754759

755760
if (generate['ofPath'] !== null) {
756761
pathString = "-o\"" + generate['ofPath'] + "\"";
762+
rootPath = generate['ofPath'];
757763
}
758764

759765
if (generate['verbose'] === true) {
@@ -766,8 +772,9 @@ ipc.on('generate', function(event, arg) {
766772
}
767773

768774
var pgApp="";
769-
if(hostplatform == "linux"){
770-
pgApp = "projectGenerator";
775+
if(hostplatform == "linux" || hostplatform == "linux64"){
776+
pgApp = pathTemp.join(rootPath, "apps/projectGenerator/commandLine/bin/projectGenerator");
777+
//pgApp = "projectGenerator";
771778
}else{
772779
pgApp = pathTemp.normalize(pathTemp.join(pathTemp.join(__dirname, "app"), "projectGenerator"));
773780
}

0 commit comments

Comments
 (0)