mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
42 lines
1020 B
TypeScript
42 lines
1020 B
TypeScript
![]() |
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)
|
||
|
}
|
||
|
|