chore: 清理macOS同步产生的重复文件
详细说明: - 删除了352个带数字后缀的重复文件 - 更新.gitignore防止未来产生此类文件 - 这些文件是由iCloud或其他同步服务冲突产生的 - 不影响项目功能,仅清理冗余文件
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
const glob = require('fast-glob');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function copyTokenizerJsonFiles(baseDir) {
|
||||
// Make sure the target directory exists
|
||||
const targetDir = path.resolve(baseDir, 'dist', 'utils', 'tokenizer');
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
// Copy all tokenizer JSON files
|
||||
const files = glob.sync('utils/tokenizer/*.json', { cwd: baseDir });
|
||||
for (const file of files) {
|
||||
const sourcePath = path.resolve(baseDir, file);
|
||||
const targetPath = path.resolve(baseDir, 'dist', file);
|
||||
fs.copyFileSync(sourcePath, targetPath);
|
||||
console.log(`Copied: ${file} -> dist/${file}`);
|
||||
}
|
||||
}
|
||||
|
||||
copyTokenizerJsonFiles(process.argv[2] || '.');
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Post-build script
|
||||
*
|
||||
* This is a separate script instead of inline npm commands because using "&&"" to chain commands in --onSuccess can cause the watch mode to hang
|
||||
*/
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
function runCommand(command) {
|
||||
try {
|
||||
execSync(command, { stdio: 'inherit' });
|
||||
} catch (error) {
|
||||
console.error(`Command failed: ${command}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Run all post-build tasks
|
||||
runCommand('npx tsc-alias -p tsconfig.build.json');
|
||||
runCommand('node scripts/copy-tokenizer-json.js .');
|
||||
runCommand('node ../../nodes-base/scripts/copy-nodes-json.js .');
|
||||
runCommand('pnpm n8n-copy-static-files');
|
||||
runCommand('pnpm n8n-generate-metadata');
|
||||
Reference in New Issue
Block a user