forked from nodejs/icu4c-data-npm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (31 loc) · 843 Bytes
/
index.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
var argv = require('minimist')(process.argv.slice(2));
var utils = require('./utils.js')
function usage() {
throw Error('Usage: <icudt___.dat> | --endian z --major y --minor x');
}
if(argv._.length === 0) {
console.log('Writing single package');
utils.writePkg(argv);
} else {
if(argv._.length !== 1) {
usage();
} else {
var fn = argv._[0];
if(fn.indexOf('icudt')!==0) {
usage();
} else {
var icumaj = fn[5]+fn[6];
var icuend = fn[7];
if(fn !== 'icudt' + icumaj + icuend + '.dat') {
usage();
}
argv.endian = icuend;
argv.major = icumaj;
argv.minor = argv.minor || ("ebl".indexOf(icuend));
console.dir(argv);
utils.writePkg(argv);
console.log('Run this command::')
console.log('rm -f dist/*.dat && cp ' + fn + ' dist/ && ( cd dist && npm publish --tag ' + icumaj+icuend + ')');
}
}
}