From e0bcb447fede1bb7da61ab5aa9b33c8f9c0d6d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Fri, 4 Mar 2016 15:44:56 +0100 Subject: [PATCH] Fixed apio path on Mac --- icestudio/js/app.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/icestudio/js/app.js b/icestudio/js/app.js index b859b222e..7aabb59b9 100644 --- a/icestudio/js/app.js +++ b/icestudio/js/app.js @@ -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) { @@ -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 { @@ -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 {