Featureful (#31)
* Fix loading within the CLI * Remove app * Remove promise handle * Add initial travis file * Add libxkbfile dependency * Add libxkbfile-dev * Add build script * Fix malformed bash statement * Remove yarn from script * Improve build script * Extract upx before usage * Only run upx if on linux * Ensure resource directory exists * Pack runnable binary * Export binary with platform * Improve build process * Install upx before running install script * Update typescript version before running nexe * Add os.release() function for multi-platform support * Update travis.yml to improve deployment * Add on CI * Update to v1.31.0 * Add libsecret * Update build target * Skip cleanup * Fix built-in extensions * Add basics for apps * Create custom DNS server * Fix forking within CLI. Fixes TS language features * Fix filename resolve * Fix default extensions path * Add custom dialog * Store workspace path * Remove outfiles * Cleanup * Always authed outside of CLI * Use location.host for client * Remove useless app interface * Remove debug file for building wordlist * Use chromes tcp host * Update patch * Build browser app before packaging * Replace all css containing file:// URLs, fix webviews * Fix save * Fix mkdir
This commit is contained in:
@ -3,57 +3,12 @@ const fse = require("fs-extra");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
const nexe = require("nexe");
|
||||
const zlib = require("zlib");
|
||||
|
||||
const nexeRoot = path.join(os.homedir(), ".nexe");
|
||||
if (!fs.existsSync(nexeRoot)) {
|
||||
throw new Error("run nexe manually on a binary to initialize it");
|
||||
}
|
||||
const listed = fs.readdirSync(nexeRoot);
|
||||
listed.forEach((list) => {
|
||||
if (list.startsWith("linux")) {
|
||||
const stat = fs.statSync(path.join(nexeRoot, list));
|
||||
if (stat.isFile()) {
|
||||
if (stat.size > 20000000) {
|
||||
throw new Error("must use upx to shrink node binary in ~/.nexe/" + list);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const tmpDir = path.join(__dirname, "../build");
|
||||
if (fs.existsSync(tmpDir)) {
|
||||
console.log("Removing old build dir...");
|
||||
fse.removeSync(tmpDir);
|
||||
}
|
||||
|
||||
console.log("Copying build files...");
|
||||
fse.copySync(path.join(__dirname, "../resources"), tmpDir, {
|
||||
recursive: true,
|
||||
});
|
||||
const modDir = path.join(tmpDir, "modules");
|
||||
fs.mkdirSync(modDir);
|
||||
fse.copySync(path.join(__dirname, "../../protocol/node_modules/node-pty/build/Release/pty.node"), path.join(modDir, "pty.node"));
|
||||
|
||||
const zipper = (p) => {
|
||||
const stat = fs.statSync(p);
|
||||
if (!stat.isDirectory()) {
|
||||
fs.writeFileSync(p + ".gz", zlib.gzipSync(fs.readFileSync(p)));
|
||||
fse.removeSync(p);
|
||||
return;
|
||||
}
|
||||
const files = fs.readdirSync(p);
|
||||
files.forEach((f) => zipper(path.join(p, f)));
|
||||
};
|
||||
|
||||
zipper(path.join(tmpDir, "web"));
|
||||
zipper(path.join(tmpDir, "bootstrap-fork.js"));
|
||||
|
||||
nexe.compile({
|
||||
debugBundle: true,
|
||||
input: path.join(__dirname, "../out/cli.js"),
|
||||
output: 'cli',
|
||||
targets: ["linux"],
|
||||
output: `cli-${process.env.TRAVIS_OS_NAME || os.platform()}`,
|
||||
targets: [os.platform()],
|
||||
native: {
|
||||
spdlog: {
|
||||
additionalFiles: [
|
||||
|
Reference in New Issue
Block a user