-
Notifications
You must be signed in to change notification settings - Fork 41
/
cli
executable file
·55 lines (43 loc) · 1.76 KB
/
cli
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
#!/usr/bin/env node
var Program = require("commander");
var Bundler = require("./lib/bundler");
var Pack = require("./package.json");
var optionIndention = Array(41).join(" ");
var titleIndention = Array(3).join(" ");
Program
.version(Pack.version)
.description(Pack.description);
Program
.command("bundle")
.description("Bundles meteor-client")
.option("-s, --source [source-dir]", [
"A path for a Meteor project which already exists. This is useful if you want the",
"bundled packages to have the same versions as in the specified project. If not",
"specified, the packages specified in the config under the \"import\" field will be",
"used instead"
].join("\n" + optionIndention))
.option("-d, --destination [destination-file]", [
"The path for the bundled module. Defaults to \"node_modules/meteor-client.js\""
].join("\n" + optionIndention))
.option("-c, --config [config-file]", [
"The path for the bundler config file. Defaults to \"meteor-client.config.json\""
].join("\n" + optionIndention))
.option("--url [connection-url]", [
"DDP default connection URL"
].join("\n" + optionIndention))
.option("--packs-dir [packages-dir]", [
"Export METEOR_PACKAGE_DIRS. Defaults to the `packages` directory under the root",
"directory of the project"
].join("\n" + optionIndention))
.option("--release [meteor-release]", [
"Use a specific release of Meteor. Defaults to the globally installed release or",
"the one used in the specified source directory"
].join("\n" + optionIndention))
.action(function (options) {
Bundler.bundle(options);
});
Program.on("--help", function (){
console.log(titleIndention + "For more information, see: " + Pack.repository.url);
console.log();
});
Program.parse(process.argv);