Fix 'Go Home' not working on OSX

This commit is contained in:
Ryan Huffman 2016-04-21 08:55:57 -07:00
parent 8631fa6cd3
commit 47d0b8f28f

View file

@ -1,21 +1,22 @@
var fs = require('fs');
var path = require('path');
exports.searchPaths = function(name, binaryType, releaseType) {
function platformExtension(name) {
if (name == "Interface" || name == "High Fidelity") {
if (process.platform == "darwin") {
return ".app/Contents/MacOS/" + name
} else if (process.platform == "win32") {
return ".exe"
} else {
return ""
}
function platformExtension(name) {
if (name == "Interface") {
if (process.platform == "darwin") {
return ".app/Contents/MacOS/" + name
} else if (process.platform == "win32") {
return ".exe"
} else {
return process.platform == "win32" ? ".exe" : ""
return ""
}
} else {
return process.platform == "win32" ? ".exe" : ""
}
}
exports.searchPaths = function(name, binaryType, releaseType) {
var extension = platformExtension(name);
var devBasePath = "../build/" + name + "/";
@ -68,6 +69,7 @@ exports.discoveredPath = function (name, binaryType, releaseType) {
try {
var stats = fs.lstatSync(testPath);
var extension = platformExtension(name);
if (stats.isFile() || (stats.isDirectory() && extension == ".app")) {
console.log("Found " + name + " at " + testPath);
@ -81,11 +83,6 @@ exports.discoveredPath = function (name, binaryType, releaseType) {
return null;
}
// for a released server console on OS X, assume the name of the interface executable is "High Fidelity"
if (releaseType && process.platform == "darwin" && name == "Interface") {
name = "High Fidelity";
}
// attempt to find a binary at the usual paths, return null if it doesn't exist
return binaryFromPaths(name, this.searchPaths(name, binaryType, releaseType));
}