-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathfilecopier.js
55 lines (43 loc) · 1.13 KB
/
filecopier.js
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
39
40
41
42
43
44
45
46
47
48
const fs = require("fs");
const { execSync } = require("child_process");
const sourceFolderPath = "/Volumes/Externa/Engineerish/ClockPhone/clock-voice";
const destinationFolderPath = "/Volumes/NO NAME";
// Source file => Target file
const fileMappings = [
["current-time-is", "001"],
["minutes", "002"],
["past", "003"],
["0", "004"],
["1", "005"],
["2", "006"],
["3", "007"],
["4", "008"],
["5", "009"],
["6", "010"],
["7", "011"],
["8", "012"],
["9", "013"],
["10", "014"],
["11", "015"],
["12", "016"],
["13", "017"],
["14", "018"],
["15", "019"],
["16", "020"],
["17", "021"],
["18", "022"],
["19", "023"],
["20", "024"],
["30", "025"],
["40", "026"],
["50", "027"]
];
console.log(fileMappings[0][0]);
for (var i = 0; i < fileMappings.length; i++) {
var mapping = fileMappings[i];
const source = sourceFolderPath + "/" + mapping[0] + ".mp3";
const destination = destinationFolderPath + "/" + mapping[1] + ".mp3";
fs.copyFileSync(source, destination);
console.log(i + ") " + source + " => " + destination);
}
let output = execSync("dot_clean '" + destinationFolderPath + "'");