-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcli.js
49 lines (41 loc) · 1.07 KB
/
cli.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
#!/usr/bin/env node
const meow = require("meow");
const oneskySync = require(".");
const cli = meow(
`
Usage
$ onesky-sync upload <input> [options]
$ onesky-sync download <ouput> [options]
Options
--api-key Required
--secret Required
--project-id Required
Download
--language
--file-name Required
Upload
--language=en
--file-name
--format=HIERARCHICAL_JSON
--content
--keep-strings=false
--allow-same-as-original=false
Example
$ onesky-sync upload ./translations/*.json --api-key=111 --secret=111 --project-id=111
$ onesky-sync download ./translations --file-name=en.json --language=ru --api-key=111 --secret=111 --project-id=111
`,
{
flags: {
keepStrings: {
type: "boolean",
default: false
},
allowSameAsOriginal: {
type: "boolean",
default: false
}
}
}
);
const [command, ...files] = cli.input;
oneskySync(command, files, cli.flags);