fix electron build
This commit is contained in:
parent
f5406a69d9
commit
ac8b9c86cb
5 changed files with 31 additions and 7 deletions
3
app.js
3
app.js
|
|
@ -334,7 +334,7 @@ function init(mod) {
|
||||||
// load modules
|
// load modules
|
||||||
lastmod(`${dir}/${root}`) && fs.readdirSync(`${dir}/${root}`).forEach(mdir => {
|
lastmod(`${dir}/${root}`) && fs.readdirSync(`${dir}/${root}`).forEach(mdir => {
|
||||||
const modpath = `${root}/${mdir}`;
|
const modpath = `${root}/${mdir}`;
|
||||||
if (dir.charAt(0) === '.') return;
|
if (dir.charAt(0) === '.' && !ENV.single) return;
|
||||||
const stats = fs.lstatSync(`${mod.dir}/${modpath}`);
|
const stats = fs.lstatSync(`${mod.dir}/${modpath}`);
|
||||||
if (!(stats.isDirectory() || stats.isSymbolicLink())) return;
|
if (!(stats.isDirectory() || stats.isSymbolicLink())) return;
|
||||||
if (util.isfile(PATH.join(mod.dir,modpath,".disable"))) return;
|
if (util.isfile(PATH.join(mod.dir,modpath,".disable"))) return;
|
||||||
|
|
@ -771,6 +771,7 @@ function getCachedFile(file, fn) {
|
||||||
} else {
|
} else {
|
||||||
logger.log({update_cache:filePath});
|
logger.log({update_cache:filePath});
|
||||||
cacheData = fn(filePath);
|
cacheData = fn(filePath);
|
||||||
|
// console.log(`NEW_CACHE_FILE: ${cachePath}`);
|
||||||
fs.writeFileSync(cachePath, cacheData);
|
fs.writeFileSync(cachePath, cacheData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ const webTmp = path.join('tmp','web');
|
||||||
fs.copySync("web", webTmp, { dereference: true });
|
fs.copySync("web", webTmp, { dereference: true });
|
||||||
|
|
||||||
const modTmp = path.join('tmp','mod');
|
const modTmp = path.join('tmp','mod');
|
||||||
fs.existsSync("mod") && fs.copySync("mod", modTmp, { dereference: true, filter:(src,dst) => {
|
if (fs.existsSync("mod"))
|
||||||
|
fs.copySync("mod", modTmp, { dereference: true, filter:(src,dst) => {
|
||||||
const ok =
|
const ok =
|
||||||
src === 'mod' ||
|
src === 'mod' ||
|
||||||
src.indexOf('mod/standalone') === 0 ||
|
src.indexOf('mod/standalone') === 0 ||
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,8 @@ self.kiri.load(api => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function file_list() {
|
function file_list() {
|
||||||
if (selected?.rec?.host) {
|
let { host, code, serial } = selected?.rec || {};
|
||||||
|
if (host && code && serial) {
|
||||||
filelist.selectedIndex = -1;
|
filelist.selectedIndex = -1;
|
||||||
$('bbl_file_size').value =
|
$('bbl_file_size').value =
|
||||||
$('bbl_file_date').value = '';
|
$('bbl_file_date').value = '';
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ module.exports = async (server) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(env.debug || env.electron)) {
|
if (!(env.debug || env.electron)) {
|
||||||
util.log('no valid context for bambu');
|
util.log('not a valid context for bambu');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
27
package.json
27
package.json
|
|
@ -86,13 +86,14 @@
|
||||||
"build-mac-intel": "npm run build -- --mac --x64",
|
"build-mac-intel": "npm run build -- --mac --x64",
|
||||||
"mklinks": "find src web -type l | xargs -I{} sh -c 'echo \"{},$(readlink {})\"' > links.csv",
|
"mklinks": "find src web -type l | xargs -I{} sh -c 'echo \"{},$(readlink {})\"' > links.csv",
|
||||||
"mac-verify": "spctl --assess -vv --type install dist/*/*.app",
|
"mac-verify": "spctl --assess -vv --type install dist/*/*.app",
|
||||||
"clear-cache": "rm -rf tmp/* data/cache/*",
|
"clear-cache": "rm -rf data/cache/* dist/ tmp/*",
|
||||||
"prebuild": "node bin/electron-pre.js",
|
"prebuild": "node bin/electron-pre.js",
|
||||||
"postbuild": "node bin/electron-post.js",
|
"postbuild": "node bin/electron-post.js",
|
||||||
"preinstall": "node bin/install-pre.js; npx webpack --config bin/webpack-three.js"
|
"preinstall": "node bin/install-pre.js; npx webpack --config bin/webpack-three.js"
|
||||||
},
|
},
|
||||||
"main": "app-el.js",
|
"main": "app-el.js",
|
||||||
"build": {
|
"build": {
|
||||||
|
"npmRebuild": false,
|
||||||
"appId": "space.grid.kiri",
|
"appId": "space.grid.kiri",
|
||||||
"productName": "KiriMoto",
|
"productName": "KiriMoto",
|
||||||
"artifactName": "KiriMoto-${os}-${arch}.${ext}",
|
"artifactName": "KiriMoto-${os}-${arch}.${ext}",
|
||||||
|
|
@ -118,10 +119,30 @@
|
||||||
"**/*"
|
"**/*"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"from": "tmp/mod/node_modules",
|
||||||
|
"to": "mod/node_modules",
|
||||||
|
"filter": [
|
||||||
|
"**/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": "tmp/mods",
|
||||||
|
"to": "mods",
|
||||||
|
"filter": [
|
||||||
|
"**/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": "tmp/mods/node_modules",
|
||||||
|
"to": "mods/node_modules",
|
||||||
|
"filter": [
|
||||||
|
"**/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
"bin/*",
|
"bin/*",
|
||||||
"conf/**/*",
|
"conf/**/*",
|
||||||
"data/**/*",
|
"data/cache/**/*",
|
||||||
"dist/**/*",
|
|
||||||
"app-el.js",
|
"app-el.js",
|
||||||
"app.js",
|
"app.js",
|
||||||
"package.json"
|
"package.json"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue