Skip to content

Commit

Permalink
Fixed apio path on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Mar 4, 2016
1 parent 08a6e32 commit e0bcb44
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions icestudio/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,17 @@ angular.module('app', ['flowChart', ])

alertify.set({ delay: 2000 });

var apio = 'export PATH=$HOME/.local/bin:$PATH; apio ';
var apio = 'apio ';
var platform = window.navigator.platform;

if (platform.indexOf('Linux') !== -1) {
var path = '$HOME/.local/bin';
apio = 'export PATH=' + path + ':$PATH; ' + apio;
}
else if (platform.indexOf('Mac') !== -1) {
var path = '/Library/Frameworks/Python.framework/Versions/2.7/bin/';
apio = 'export PATH=' + path + ':$PATH; ' + apio;
}

// Check apio backend
child_process.exec(apio, function(error, stdout, stderr) {
Expand Down Expand Up @@ -188,7 +198,7 @@ angular.module('app', ['flowChart', ])
alertify.error('Build fail');
}
else if (stdout) {
if (stdout.toString().indexOf('Error') != -1) {
if (stdout.toString().indexOf('Error 1') != -1) {
alertify.error('Build fail');
}
else {
Expand All @@ -210,7 +220,7 @@ angular.module('app', ['flowChart', ])
alertify.error('Upload fail');
}
else if (stdout) {
if (stdout.toString().indexOf('Error') != -1) {
if (stdout.toString().indexOf('Error 1') != -1) {
alertify.error('Upload fail');
}
else {
Expand Down

0 comments on commit e0bcb44

Please sign in to comment.