mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
+27
-21
@@ -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')
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user