mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:17:34 +02:00
add initial local process search
This commit is contained in:
parent
a741208688
commit
c80e6f7da4
2 changed files with 63 additions and 9 deletions
|
@ -13,9 +13,9 @@ npm start
|
||||||
|
|
||||||
To run, the console needs to find a build of Interface, domain-server, and assignment-client.
|
To run, the console needs to find a build of Interface, domain-server, and assignment-client.
|
||||||
|
|
||||||
The command `npm start` tells the console to look for debug builds of those binaries in a build folder beside this console folder.
|
The command `npm start` tells the console to look for builds of those binaries in a build folder beside this console folder.
|
||||||
|
|
||||||
To look for release builds in the build folder, you'll want `npm run local-release`.
|
On platforms with separate build folders for release and debug libraries `npm start` will choose the debug binaries. On those platforms if you prefer to use local release builds you'll want `npm run local-release`.
|
||||||
|
|
||||||
### Packaging
|
### Packaging
|
||||||
|
|
||||||
|
|
|
@ -24,25 +24,79 @@ var APP_ICON = 'resources/tray-icon.png';
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
app.on('window-all-closed', function() {
|
app.on('window-all-closed', function() {
|
||||||
|
<<<<<<< HEAD
|
||||||
// On OS X it is common for applications and their menu bar
|
// On OS X it is common for applications and their menu bar
|
||||||
// to stay active until the user quits explicitly with Cmd + Q
|
// to stay active until the user quits explicitly with Cmd + Q
|
||||||
if (process.platform != 'darwin') {
|
if (process.platform != 'darwin') {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
// On OS X it is common for applications and their menu bar
|
||||||
|
// to stay active until the user quits explicitly with Cmd + Q
|
||||||
|
if (process.platform != 'darwin') {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
>>>>>>> add initial local process search
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check command line arguments to see how to find binaries
|
// Check command line arguments to see how to find binaries
|
||||||
var argv = require('yargs');
|
var argv = require('yargs').argv;
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
if (argv.localDebugBuilds) {
|
function localProcessForBinary(name, preferRelease) {
|
||||||
// check in a dev folder structure for debug binaries
|
var path = "../build/" + name + "/";
|
||||||
} else if (argv.localReleaseBuilds) {
|
|
||||||
// check in a dev folder structure for release binaries
|
function processFromPath(name, path) {
|
||||||
} else {
|
function platformExtension() {
|
||||||
// check beside the console application for the binaries
|
return process.platform == 'win32' ? ".exe" : ""
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var fullPath = path + name + platformExtension();
|
||||||
|
|
||||||
|
var stats = fs.lstatSync(path + name + platformExtension())
|
||||||
|
|
||||||
|
if (stats.isFile()) {
|
||||||
|
console.log("Found " + name + " at " + fullPath);
|
||||||
|
return fullPath;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Executable with name " + name + " not found at path " + path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// does the executable exist at this path already?
|
||||||
|
// if so assume we're on a platform that doesn't have Debug/Release
|
||||||
|
// folders and just use the discovered executable
|
||||||
|
var matchingProcess = processFromPath(name, path);
|
||||||
|
|
||||||
|
if (matchingProcess == null) {
|
||||||
|
if (preferRelease) {
|
||||||
|
// check if we can find the executable in a Release folder below this path
|
||||||
|
matchingProcess = processFromPath(name, path + "Release/");
|
||||||
|
} else {
|
||||||
|
// check if we can find the executable in a Debug folder below this path
|
||||||
|
matchingProcess = processFromPath(name, path + "Debug/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matchingProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (argv.localDebugBuilds) {
|
||||||
|
// check in a dev folder structure for debug binaries
|
||||||
|
var interfaceProcess = localProcessForBinary("Interface");
|
||||||
|
var dsProcess = localProcessForBinary("domain-server");
|
||||||
|
var acProcess = localProcessForBinary("assignment-client");
|
||||||
|
} else if (argv.localReleaseBuilds) {
|
||||||
|
// check in a dev folder structure for release binaries
|
||||||
|
} else {
|
||||||
|
// check beside the console application for the binaries
|
||||||
|
}
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
app.on('ready', function() {
|
app.on('ready', function() {
|
||||||
|
|
Loading…
Reference in a new issue