mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 02:55:25 +02:00
Merge pull request #7729 from huffman/fix/osx-go-home
Fix 'Go Home' not working on OSX
This commit is contained in:
commit
85a8c90de7
1 changed files with 13 additions and 16 deletions
|
@ -1,21 +1,22 @@
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
exports.searchPaths = function(name, binaryType, releaseType) {
|
function platformExtension(name) {
|
||||||
function platformExtension(name) {
|
if (name == "Interface") {
|
||||||
if (name == "Interface" || name == "High Fidelity") {
|
if (process.platform == "darwin") {
|
||||||
if (process.platform == "darwin") {
|
return ".app/Contents/MacOS/" + name
|
||||||
return ".app/Contents/MacOS/" + name
|
} else if (process.platform == "win32") {
|
||||||
} else if (process.platform == "win32") {
|
return ".exe"
|
||||||
return ".exe"
|
|
||||||
} else {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return process.platform == "win32" ? ".exe" : ""
|
return ""
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return process.platform == "win32" ? ".exe" : ""
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
exports.searchPaths = function(name, binaryType, releaseType) {
|
||||||
var extension = platformExtension(name);
|
var extension = platformExtension(name);
|
||||||
var devBasePath = "../build/" + name + "/";
|
var devBasePath = "../build/" + name + "/";
|
||||||
|
|
||||||
|
@ -68,6 +69,7 @@ exports.discoveredPath = function (name, binaryType, releaseType) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var stats = fs.lstatSync(testPath);
|
var stats = fs.lstatSync(testPath);
|
||||||
|
var extension = platformExtension(name);
|
||||||
|
|
||||||
if (stats.isFile() || (stats.isDirectory() && extension == ".app")) {
|
if (stats.isFile() || (stats.isDirectory() && extension == ".app")) {
|
||||||
console.log("Found " + name + " at " + testPath);
|
console.log("Found " + name + " at " + testPath);
|
||||||
|
@ -81,11 +83,6 @@ exports.discoveredPath = function (name, binaryType, releaseType) {
|
||||||
return null;
|
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
|
// attempt to find a binary at the usual paths, return null if it doesn't exist
|
||||||
return binaryFromPaths(name, this.searchPaths(name, binaryType, releaseType));
|
return binaryFromPaths(name, this.searchPaths(name, binaryType, releaseType));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue