mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
.github
docs
script
checkVersion.cjs
copy-core.cjs
gen-version.ts
napcat-custom.bat
napcat-gc.ps1
napcat-log.ps1
napcat-utf8.bat
napcat-utf8.ps1
napcat.bat
napcat.ps1
napcat.sh
src
static
test
.editorconfig
.env.development
.env.production
.eslintrc.cjs
.gitignore
.gitmodules
LICENSE
README.md
logo.png
package.json
tsconfig.json
vite.config.ts
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
let fs = require('fs');
|
|
let path = require('path');
|
|
|
|
const coreDistDir = path.join(path.resolve(__dirname, '../'), 'src/core/dist/core/src');
|
|
const coreLibDir = path.join(path.resolve(__dirname, '../'), 'src/core.lib/src');
|
|
|
|
function copyDir(currentPath, outputDir) {
|
|
fs.readdir(currentPath, { withFileTypes: true }, (err, entries) => {
|
|
if (err?.errno === -4058) return;
|
|
|
|
entries.forEach(entry => {
|
|
const localBasePath = path.join(currentPath, entry.name);
|
|
const outputLocalBasePath = path.join(outputDir, entry.name);
|
|
|
|
if (entry.isDirectory()) {
|
|
// 如果是目录,递归调用
|
|
if (!fs.existsSync(outputLocalBasePath)) {
|
|
fs.mkdirSync(outputLocalBasePath, { recursive: true });
|
|
}
|
|
copyDir(localBasePath, outputLocalBasePath);
|
|
}
|
|
else{
|
|
// 如果是文件,直接复制
|
|
fs.copyFile(localBasePath, outputLocalBasePath, (err) => {
|
|
if (err) throw err;
|
|
});
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
copyDir(coreDistDir, coreLibDir);
|