1 | #!/usr/bin/env node
|
2 | // vim: set filetype=javascript:
|
3 | var program = require('commander');
|
4 | var fs = require('fs');
|
5 | var lib = require('../src/Config');
|
6 |
|
7 | program
|
8 | .option('--name <name>', 'name of the runtime as returned by getruntime.')
|
9 | .option('--command <command>', 'executable command to start the runtime server process.')
|
10 | .option('--host <hostname>', 'hostname of server to connect to. [localhost]', String, 'localhost')
|
11 | .option('--port <port>', 'port of server to connect to. [8080]', Number, 8080)
|
12 | .option('--collection <collection>', 'name of the collection in which to find the components required for testing. [core]', String, 'core')
|
13 | .parse(process.argv);
|
14 |
|
15 | if (!program.name) {
|
16 | console.log('You must specify a name');
|
17 | }
|
18 |
|
19 | if (!program.command) {
|
20 | console.log('You must specify a command');
|
21 | }
|
22 |
|
23 | var values = {
|
24 | name: program.name,
|
25 | command: program.command,
|
26 | host: program.host,
|
27 | port: program.port,
|
28 | collection: program.collection
|
29 | };
|
30 |
|
31 | lib.saveStored(values);
|
32 |
|
33 | console.log('Stored the following configuration to ' + lib.getStoredPath());
|
34 | console.log();
|
35 | for (var name in values) {
|
36 | console.log(name + ': ' + values[name]);
|
37 | }
|
38 | console.log();
|
39 | console.log('To test, run `fbp-test` from this directory');
|