Skip to content

Commit

Permalink
Merge pull request #263 from liquidz/fix-261
Browse files Browse the repository at this point in the history
Next release
  • Loading branch information
liquidz authored Sep 20, 2024
2 parents 197c707 + df8a718 commit 50c5bf5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
All notable changes to this project will be documented in this file. This change log follows the conventions of http://keepachangelog.com/[keepachangelog.com].

== Unreleased (dev)
// {{{
=== Changed
* Bumped clj-yaml to 1.0.28.

=== Fixed
* https://github.com/liquidz/antq/issues/261[#261]: Fixed to work correctly when used as a tool.
// }}}

== 2.9.1227 (2024-09-07)
// {{{
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
org.clojure/core.async {:mvn/version "1.6.681"}
org.clojure/tools.deps {:mvn/version "0.21.1449"}
org.clojure/data.json {:mvn/version "2.5.0"}
clj-commons/clj-yaml {:mvn/version "1.0.27"}
clj-commons/clj-yaml {:mvn/version "1.0.28"}
version-clj/version-clj {:mvn/version "2.0.3"}
rewrite-clj/rewrite-clj {:mvn/version "1.1.48"}
com.github.liquidz/rewrite-indented {:mvn/version "0.2.44"}
Expand Down
10 changes: 7 additions & 3 deletions src/antq/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,13 @@
:latest-name verified-name))
deps))

(defn- system-exit
[n]
(System/exit n))

(defn exit
[outdated-deps]
(System/exit (if (seq outdated-deps) 1 0)))
(system-exit (if (seq outdated-deps) 1 0)))

(defn fetch-deps
[options]
Expand Down Expand Up @@ -303,7 +307,7 @@
errors
(do (doseq [e errors]
(log/error e))
(System/exit 1))
(system-exit 1))

(seq deps)
(let [alog (log/start-async-logger!)
Expand All @@ -323,7 +327,7 @@

:else
(do (log/info "No project file")
(System/exit 1)))))
(system-exit 1)))))

(defn -main
[& args]
Expand Down
6 changes: 5 additions & 1 deletion src/antq/tool.clj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@
[& [options]]
(let [options (prepare-options options)]
(binding [log/*verbose* (:verbose options false)]
(core/main* options nil))))
(with-redefs [core/system-exit (fn [n]
(when (not= 0 n)
(throw (ex-info "Exited" {:code n})))
n)]
(core/main* options nil)))))

(defn help
[& _]
Expand Down

0 comments on commit 50c5bf5

Please sign in to comment.