import fs from 'fs-extra' import path from 'path' // Get the list of apps from command-line arguments const apps = process.argv.slice(2) if (apps.length === 0) { console.error('Please provide at least one app name.') process.exit(1) } // Update the source directory to the correct path const sourceDir = path.resolve(process.cwd(), 'scripts/i18n/dictionaries') if (!fs.existsSync(sourceDir)) { console.error(`Source directory does not exist: ${sourceDir}`) process.exit(1) } // Iterate over each app and copy the dictionaries folder apps.forEach((app) => { const targetDir = path.resolve(process.cwd(), `apps/${app}/i18n/dictionaries`) try { // Ensure the target directory exists fs.ensureDirSync(targetDir) // Copy the dictionaries folder fs.copySync(sourceDir, targetDir) console.log(`Copied dictionaries to ${targetDir}`) } catch (error) { console.error(`Failed to copy dictionaries to ${targetDir}:`, error) } })