-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage-bin.js
executable file
·73 lines (52 loc) · 1.49 KB
/
package-bin.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env node
const mod = {
// VALUE
_ValueDirectory: process.cwd(),
_ValueLanguageID: undefined,
// CONTROL
ControlCompile(args) {
require('./main.js').OLSKInternationalWriteCompilationFile(mod._ValueDirectory, mod._ValueLanguageID);
},
ControlSpread(args) {
require('./main.js').OLSKInternationalSpreadCompilationFile(mod._ValueDirectory);
console.log('Spread ', mod._ValueDirectory);
},
ControlAdd(args) {
require('./main.js').OLSKInternationalAddControllerLanguageCode(mod._ValueDirectory, args[3]);
},
ControlPrintCompilationFilePath(args) {
console.log(require('./main.js')._OLSKInternationalCompilationFilePath(mod._ValueDirectory));
},
// SETUP
SetupEverything () {
mod.SetupValueDirectory();
mod.SetupValueLanguageID();
},
SetupValueDirectory () {
if (process.argv[2]) {
mod._ValueDirectory = require('path').resolve(process.argv[2]);
}
},
SetupValueLanguageID () {
if (process.argv[3]) {
mod._ValueLanguageID = process.argv[3];
}
},
// LIFECYCLE
LifecycleScriptDidLoad() {
mod.SetupEverything();
if (process.argv[1].endsWith('olsk-i18n-compile')) {
return mod.ControlCompile();
}
if (process.argv[1].endsWith('olsk-i18n-spread')) {
return mod.ControlSpread();
}
if (process.argv[1].endsWith('olsk-i18n-add')) {
return mod.ControlAdd(process.argv);
}
if (process.argv[1].endsWith('_olsk-i18n-compile-file-path')) {
return mod.ControlPrintCompilationFilePath(process.argv);
}
},
};
mod.LifecycleScriptDidLoad();