mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Fix the problem of Windows system building error (#16653)
This commit is contained in:
21
packages/@n8n/nodes-langchain/scripts/copy-tokenizer-json.js
Normal file
21
packages/@n8n/nodes-langchain/scripts/copy-tokenizer-json.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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] || '.');
|
||||
Reference in New Issue
Block a user