forked from Urigo/meteor-client-bundler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli
executable file
·45 lines (35 loc) · 1.33 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
#!/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"
])
.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);