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

Loading…
Cancel
Save