Browse Source

Check for blank cli arguments

master
Dylan Baker 5 years ago
parent
commit
c9c2e34940
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      bin/oslo.js

+ 3
- 3
bin/oslo.js View File

10
   constructor(opts) {
10
   constructor(opts) {
11
     let output
11
     let output
12
 
12
 
13
-    if (opts.f) {
13
+    if (opts.f && opts.f !== true) {
14
       output = this.file(path.join(process.cwd(), opts.f))
14
       output = this.file(path.join(process.cwd(), opts.f))
15
-    } else if (opts.d) {
15
+    } else if (opts.d && opts.d !== true) {
16
       if (!opts.o) {
16
       if (!opts.o) {
17
         console.log(
17
         console.log(
18
           'Output directory required. Invoke oslo with `-o path/to/output/directory`',
18
           'Output directory required. Invoke oslo with `-o path/to/output/directory`',
23
         this.absolutePath(opts.d),
23
         this.absolutePath(opts.d),
24
         this.absolutePath(opts.o),
24
         this.absolutePath(opts.o),
25
       )
25
       )
26
-    } else if (opts.e) {
26
+    } else if (opts.e && opts.e !== true) {
27
       output = this.inline(opts.e)
27
       output = this.inline(opts.e)
28
     } else {
28
     } else {
29
       this.printUsage()
29
       this.printUsage()

Loading…
Cancel
Save