mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 19:47:38 +02:00
fix for search paths for distributed server-console
This commit is contained in:
parent
cbc0c4e31d
commit
6c5c3a856b
3 changed files with 41 additions and 16 deletions
|
@ -18,8 +18,8 @@
|
|||
},
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"start": "electron . --local-debug-builds --debug",
|
||||
"local-release": "electron . --local-release-builds --debug",
|
||||
"start": "electron . --binary-type local-debug --debug",
|
||||
"local-release": "electron . --binary-type local-release --debug",
|
||||
"packager": "node packager.js"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -128,12 +128,11 @@ var acPath = null;
|
|||
|
||||
var debug = argv.debug;
|
||||
|
||||
var binaryType = argv.binaryType;
|
||||
|
||||
if (argv.localDebugBuilds || argv.localReleaseBuilds) {
|
||||
interfacePath = pathFinder.discoveredPath("Interface", argv.localReleaseBuilds);
|
||||
dsPath = pathFinder.discoveredPath("domain-server", argv.localReleaseBuilds);
|
||||
acPath = pathFinder.discoveredPath("assignment-client", argv.localReleaseBuilds);
|
||||
}
|
||||
interfacePath = pathFinder.discoveredPath("Interface", binaryType);
|
||||
dsPath = pathFinder.discoveredPath("domain-server", binaryType);
|
||||
acPath = pathFinder.discoveredPath("assignment-client", binaryType);
|
||||
|
||||
function binaryMissingMessage(displayName, executableName, required) {
|
||||
var message = "The " + displayName + " executable was not found.\n";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var fs = require('fs');
|
||||
|
||||
exports.searchPaths = function(name, preferRelease) {
|
||||
exports.searchPaths = function(name, binaryType) {
|
||||
function platformExtension(name) {
|
||||
if (name == "Interface") {
|
||||
if (process.platform == "darwin") {
|
||||
|
@ -16,15 +16,41 @@ exports.searchPaths = function(name, preferRelease) {
|
|||
}
|
||||
|
||||
var extension = platformExtension(name);
|
||||
var basePath = "../build/" + name + "/";
|
||||
var devBasePath = "../build/" + name + "/";
|
||||
|
||||
return [
|
||||
basePath + name + extension,
|
||||
basePath + (preferRelease ? "Release/" : "Debug/") + name + extension
|
||||
];
|
||||
var paths = [];
|
||||
|
||||
if (binaryType == "local-release" || binaryType == "local-debug") {
|
||||
// check in the developer build tree for binaries
|
||||
paths = [
|
||||
devBasePath + name + extension,
|
||||
devBasePath + (binaryType == "local-release" ? "Release/" : "Debug/") + name + extension
|
||||
]
|
||||
} else {
|
||||
// check directly beside the binary
|
||||
paths = [
|
||||
__dirname + "/" + name + extension,
|
||||
];
|
||||
|
||||
// check if we're inside an app bundle on OS X
|
||||
if (process.platform == "darwin") {
|
||||
var contentPath = ".app/Contents/";
|
||||
var contentEndIndex = __dirname.indexOf(contentPath);
|
||||
|
||||
if (contentEndIndex != -1) {
|
||||
// this is an app bundle, check in Contents/MacOS for the binaries
|
||||
var appPath = __dirname.substring(0, contentEndIndex);
|
||||
appPath += ".app/Contents/MacOS/";
|
||||
|
||||
paths.push(appPath + name + extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
exports.discoveredPath = function (name, preferRelease) {
|
||||
exports.discoveredPath = function (name, binaryType) {
|
||||
function binaryFromPaths(name, paths) {
|
||||
for (var i = 0; i < paths.length; i++) {
|
||||
var path = paths[i];
|
||||
|
@ -37,7 +63,7 @@ exports.discoveredPath = function (name, preferRelease) {
|
|||
return path;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Executable with name " + name + " not found at path " + path);
|
||||
console.log("Executable with name " + name + " not found at path " + path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,5 +71,5 @@ exports.discoveredPath = function (name, preferRelease) {
|
|||
}
|
||||
|
||||
// attempt to find a binary at the usual paths, return null if it doesn't exist
|
||||
return binaryFromPaths(name, this.searchPaths(name, preferRelease));
|
||||
return binaryFromPaths(name, this.searchPaths(name, binaryType));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue