mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 14:20:36 +08:00
build(copy-dist): use sync copying
since this is a "standalone" script we are running and no other JS scritps are running "in the background", there's no real benefit for async here.
This commit is contained in:
parent
37f1525d0e
commit
a816abb372
1 changed files with 7 additions and 7 deletions
|
|
@ -11,11 +11,11 @@ function log(...args: any[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function copyNodeModuleFileOrFolder(source: string) {
|
function copyNodeModuleFileOrFolder(source: string) {
|
||||||
const destination = path.join(DEST_DIR, source);
|
const destination = path.join(DEST_DIR, source);
|
||||||
log(`Copying ${source} to ${destination}`);
|
log(`Copying ${source} to ${destination}`);
|
||||||
await fs.ensureDir(path.dirname(destination));
|
fs.ensureDirSync(path.dirname(destination));
|
||||||
await fs.copy(source, destination);
|
fs.copySync(source, destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
const copy = async () => {
|
const copy = async () => {
|
||||||
|
|
@ -41,7 +41,7 @@ const copy = async () => {
|
||||||
|
|
||||||
for (const asset of assetsToCopy) {
|
for (const asset of assetsToCopy) {
|
||||||
log(`Copying ${asset}`);
|
log(`Copying ${asset}`);
|
||||||
await fs.copy(asset, path.join(DEST_DIR, asset));
|
fs.copySync(asset, path.join(DEST_DIR, asset));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -50,7 +50,7 @@ const copy = async () => {
|
||||||
const publicDirsToCopy = ["./src/public/app/doc_notes"];
|
const publicDirsToCopy = ["./src/public/app/doc_notes"];
|
||||||
const PUBLIC_DIR = path.join(DEST_DIR, "src", "public", "app-dist");
|
const PUBLIC_DIR = path.join(DEST_DIR, "src", "public", "app-dist");
|
||||||
for (const dir of publicDirsToCopy) {
|
for (const dir of publicDirsToCopy) {
|
||||||
await fs.copy(dir, path.join(PUBLIC_DIR, path.basename(dir)));
|
fs.copySync(dir, path.join(PUBLIC_DIR, path.basename(dir)));
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeModulesFile = [
|
const nodeModulesFile = [
|
||||||
|
|
@ -66,7 +66,7 @@ const copy = async () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const file of nodeModulesFile) {
|
for (const file of nodeModulesFile) {
|
||||||
await copyNodeModuleFileOrFolder(file);
|
copyNodeModuleFileOrFolder(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeModulesFolder = [
|
const nodeModulesFolder = [
|
||||||
|
|
@ -99,7 +99,7 @@ const copy = async () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const folder of nodeModulesFolder) {
|
for (const folder of nodeModulesFolder) {
|
||||||
await copyNodeModuleFileOrFolder(folder);
|
copyNodeModuleFileOrFolder(folder);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue