This commit is contained in:
zuowei1216
2025-12-22 21:06:29 +08:00
parent 8ea58fe480
commit 1b19ff1b92
179 changed files with 21895 additions and 3774 deletions

View File

@@ -0,0 +1,25 @@
import fs from 'fs'
import path from 'path'
import os from 'os'
export const copyFolderSync = (from, to) => {
if (!fs.existsSync(to)) {
fs.mkdirSync(to);
}
fs.readdirSync(from).forEach((element) => {
const srcPath = path.join(from, element);
const destPath = path.join(to, element);
if (fs.lstatSync(srcPath).isFile()) {
fs.copyFileSync(srcPath, destPath);
} else {
copyFolderSync(srcPath, destPath);
}
});
};
export function isMac() {
return os.platform() === 'darwin'
}