issue #24672 instead of removing pre-req check in xtmfg_package, adding a new enterpr...
[xtuple] / scripts / import_dictionary.js
1 #!/usr/bin/env node
2 /*jshint node:true, indent:2, curly:false, eqeqeq:true, immed:true,
3 latedef:true, newcap:true, noarg:true,
4 regexp:true, undef:true, strict:true, trailing:true, white:true */
5
6 //
7 // This file really just parses the arguments, and sends the real work
8 // off to scripts/lib/build_dictionary.js.
9 //
10 (function () {
11   "use strict";
12
13   var program = require('commander'),
14     importDictionary = require("./lib/build_dictionary").importDictionary;
15
16   program
17     .option('-d, --database [database name]', 'Database name to import to.')
18     .option('-f, --filename [/path/to/filename]', 'Path to xTuple dictionary js file.')
19     .parse(process.argv);
20
21   importDictionary(program.database, program.filename, function (err, res) {
22     if (err) {
23       console.log("Import failed", err);
24       return;
25     }
26     console.log("Success!");
27   });
28
29 }());