mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
chore(monorepo/server): move dist & some scripts
This commit is contained in:
41
apps/electron/scripts/copy-dist.ts
Normal file
41
apps/electron/scripts/copy-dist.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import fs from "fs-extra";
|
||||
import path from "path";
|
||||
|
||||
const DEST_DIR = "./build";
|
||||
|
||||
const VERBOSE = process.env.VERBOSE;
|
||||
|
||||
function log(...args: any[]) {
|
||||
if (VERBOSE) {
|
||||
console.log(...args);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const assetsToCopy = new Set([
|
||||
"./forge.config.cjs",
|
||||
"./bin/electron-forge/desktop.ejs",
|
||||
"./bin/electron-forge/sign-windows.cjs",
|
||||
]);
|
||||
|
||||
for (const asset of assetsToCopy) {
|
||||
log(`Copying ${asset}`);
|
||||
fs.copySync(asset, path.join(DEST_DIR, asset));
|
||||
}
|
||||
|
||||
/**
|
||||
* Directories to be copied relative to the project root into <resource_dir>/src/public/app-dist.
|
||||
*/
|
||||
const publicDirsToCopy = ["./src/public/app/doc_notes"];
|
||||
const PUBLIC_DIR = path.join(DEST_DIR, "src", "public", "app-dist");
|
||||
for (const dir of publicDirsToCopy) {
|
||||
fs.copySync(dir, path.join(PUBLIC_DIR, path.basename(dir)));
|
||||
}
|
||||
|
||||
console.log("Copying complete!")
|
||||
|
||||
} catch(err) {
|
||||
console.error("Error during copy:", err.message)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user