-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
executable file
·36 lines (25 loc) · 919 Bytes
/
main.js
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
#!/usr/bin/env node
'use strict';
var ArgumentParser = require('argparse').ArgumentParser;
var path = require('path');
var pkg = require(path.join(__dirname, 'package.json'));
var parser = new ArgumentParser({
addHelp: true,
description: pkg.description,
version: pkg.version
});
parser.addArgument(['files'], {
help: 'env files to load configuration from. Least specific first. The configuration will be merged. JS files will be executed where module.exports contains the config',
nargs: '+'
});
parser.addArgument(['--only'], {
help: 'If set, will only write the files for one project.',
});
parser.addArgument(['--inline'], {
help: 'If set, will output the env to stdout instead of files.',
action: 'storeTrue'
});
var args = parser.parseArgs();
var DotenvManager = require('./index.js');
var manager = new DotenvManager(args.files, args.only, args.inline);
manager.run();