Fix building LOOT as a native Linux application.

Not all Windows-specific code has equivalent Linux code, file path to
URL conversion is hacky, and only that LOOT launches correctly with no
game detected has been tested.
This commit is contained in:
Oliver Hamlet
2015-10-29 18:20:14 +00:00
parent f837e3a235
commit d874fbb52c
14 changed files with 377 additions and 148 deletions
+27 -21
View File
@@ -4,6 +4,7 @@
var child_process = require('child_process');
var path = require('path');
var fs = require('fs');
var os = require('os');
var helpers = require('./helpers');
if (process.argv.length < 3) {
@@ -12,27 +13,32 @@ if (process.argv.length < 3) {
var root_path = process.argv[2];
}
if (helpers.isMultiArch(root_path)) {
var output_path = path.join(root_path, 'build', '32', 'Release', 'resources', 'ui');
} else {
var output_path = path.join(root_path, 'build', 'Release', 'resources', 'ui');
}
var release_paths = helpers.getAppReleasePaths(root_path);
// Makes sure output directory exists first.
try {
fs.mkdirSync(output_path);
} catch (e) {
if (e.code != 'EEXIST') {
console.log(e);
for (var i = 0; i < release_paths.length; ++i) {
var output_path = path.join(release_paths[i].path, 'resources', 'ui');
// Makes sure output directory exists first.
try {
fs.mkdirSync(output_path);
} catch (e) {
if (e.code != 'EEXIST') {
console.log(e);
}
}
}
child_process.execFileSync('vulcanize.cmd', [
'--inline',
'--strip',
'--config',
path.join(root_path, 'scripts', 'vulcanize.config.json'),
'-o',
path.join(output_path, 'index.html'),
path.join(root_path, 'src', 'gui', 'html', 'index.html')
]);
var vulcanize = 'vulcanize';
if (os.platform() == 'win32') {
vulcanize += '.cmd';
}
child_process.execFileSync('vulcanize.cmd', [
'--inline',
'--strip',
'--config',
path.join(root_path, 'scripts', 'vulcanize.config.json'),
'-o',
path.join(output_path, 'index.html'),
path.join(root_path, 'src', 'gui', 'html', 'index.html')
]);
}