mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 04:43:37 +02:00
Fix 'Go Home' not working on OSX
This commit is contained in:
parent
8631fa6cd3
commit
47d0b8f28f
1 changed files with 13 additions and 16 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue