UNPKG

1.22 kBPlain TextView Raw
1#!/usr/bin/env node
2// vim: set filetype=javascript:
3var program = require('commander');
4var fs = require('fs');
5var lib = require('../src/Config');
6
7program
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
15if (!program.name) {
16 console.log('You must specify a name');
17}
18
19if (!program.command) {
20 console.log('You must specify a command');
21}
22
23var values = {
24 name: program.name,
25 command: program.command,
26 host: program.host,
27 port: program.port,
28 collection: program.collection
29};
30
31lib.saveStored(values);
32
33console.log('Stored the following configuration to ' + lib.getStoredPath());
34console.log();
35for (var name in values) {
36 console.log(name + ': ' + values[name]);
37}
38console.log();
39console.log('To test, run `fbp-test` from this directory');