Skip to content

Commit d0eed0f

Browse files
committed
Allow for optional cleaning during parse. Defaults now to false.
1 parent d7cf87a commit d0eed0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/parse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ program
1010
.option('-p, --path [type]', 'Input path', './chat')
1111
.option('-o, --output [type]', 'Output options', 'data.json')
1212
.option('-f, --force [type]', 'Force save if output file already exists', false)
13+
.option('-c, --clean [type]', 'Clean -> drops the mongodown collection', false)
1314
.option('-F, --facts [type]', 'Fact system files path', files => files.split(','), [])
1415
.option('--host [type]', 'Mongo Host', 'localhost')
1516
.option('--port [type]', 'Mongo Port', '27017')
@@ -28,7 +29,7 @@ fs.exists(program.output, (exists) => {
2829
return process.exit();
2930
}
3031

31-
return facts.load(mongoURI, program.facts, true, (err, factSystem) => {
32+
return facts.load(mongoURI, program.facts, program.clean, (err, factSystem) => {
3233
parser.parseDirectory(program.path, { factSystem }, (err, result) => {
3334
if (err) {
3435
console.error(`Error parsing bot script: ${err}`);

0 commit comments

Comments
 (0)