-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy-localizations.js
More file actions
38 lines (30 loc) · 981 Bytes
/
copy-localizations.js
File metadata and controls
38 lines (30 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const fs = require("fs");
const path = require("path");
function copyDirContents(srcDir, destDir) {
if (!fs.existsSync(srcDir)) {
console.warn(`Source directory does not exist: ${srcDir}`);
return;
}
fs.mkdirSync(destDir, { recursive: true });
const items = fs.readdirSync(srcDir);
for (const item of items) {
const srcPath = path.join(srcDir, item);
const destPath = path.join(destDir, item);
const stat = fs.statSync(srcPath);
if (stat.isDirectory()) {
copyDirContents(srcPath, destPath);
} else {
fs.copyFileSync(srcPath, destPath);
console.log(`✅ Copied ${srcPath} → ${destPath}`);
}
}
}
function run() {
console.log("📦 Copying localization files...");
// iOS InfoPlist.strings
const iosLocalesDir = path.join(__dirname, "./locales");
const iosDestRoot = path.join(__dirname, "./ios");
copyDirContents(iosLocalesDir, iosDestRoot);
console.log("🎉 Localization files copied.");
}
run();