Skip to content

Commit d80d85f

Browse files
authored
Merge pull request #132 from hackberrydev/execute-commands
Run commands when plan errors are empty
2 parents adce792 + 38947e7 commit d80d85f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/alas.janet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@
4545
parse-result (plan_parser/parse plan-string)
4646
parse-errors (parse-result :errors)
4747
plan (parse-result :plan)]
48-
(if parse-errors
49-
(errors/print-errors parse-errors (errors/exit-status-codes :parse-error))
48+
(if (empty? parse-errors)
5049
(let [{:plan new-plan :errors run-errors} (run-commands plan file-path arguments)]
5150
(if (empty? run-errors)
5251
(let [serialize-empty-inbox (plan_parser/serialize-empty-inbox? plan-string)
5352
new-plan-string (plan_serializer/serialize
5453
new-plan
5554
{:serialize-empty-inbox serialize-empty-inbox})]
5655
(file_repository/save new-plan-string file-path))
57-
(errors/print-errors run-errors (errors/exit-status-codes :command-error))))))))
56+
(errors/print-errors run-errors (errors/exit-status-codes :command-error)))
57+
(errors/print-errors parse-errors (errors/exit-status-codes :parse-error)))))))
5858

5959
(defn- run-with-arguments [arguments]
6060
(def file-path (arguments :default))

0 commit comments

Comments
 (0)