aboutsummaryrefslogtreecommitdiff
path: root/src/cljcc/util.clj
diff options
context:
space:
mode:
authorShagun Agrawal <agrawalshagun07@gmail.com>2024-07-26 00:03:57 +0530
committerShagun Agrawal <agrawalshagun07@gmail.com>2024-07-26 00:03:57 +0530
commitb6de8db464151fa1300c5a47e508e9e792d034d0 (patch)
treefcff2e637d27de228d869f884f9aa33d8cbabbb4 /src/cljcc/util.clj
parent264c71e3a7666bc234a5dd62b1bcc36c89d1949d (diff)
Add cli options for pasing and codegen
Add cli options specific for only parsing and codegen add logger for help in debugging
Diffstat (limited to 'src/cljcc/util.clj')
-rw-r--r--src/cljcc/util.clj9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cljcc/util.clj b/src/cljcc/util.clj
index 1087029..81419e4 100644
--- a/src/cljcc/util.clj
+++ b/src/cljcc/util.clj
@@ -1,5 +1,6 @@
(ns cljcc.util
- (:require [clojure.java.shell :refer [sh]]))
+ (:require [clojure.java.shell :refer [sh]]
+ [cljcc.log :as log]))
(defn get-os []
(let [os-name (.toLowerCase (System/getProperty "os.name"))]
@@ -17,3 +18,9 @@
(if (mac-aarch64?)
(apply sh "arch" "-x86_64" command args)
(apply sh command args)))
+
+(defn exit [status msg]
+ (if (= status 0)
+ (log/info msg)
+ (log/error msg))
+ (System/exit status))