diff --git a/CHANGELOG.md b/CHANGELOG.md index b7383c3e..4963fdc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ A preview of the next release can be installed from - [#1646](https://github.com/babashka/babashka/issues/1646): command-line-args are dropped when file exists with same name - [#1645](https://github.com/babashka/babashka/issues/1645): Support for clojure.lang.LongRange - [#1652](https://github.com/babashka/babashka/issues/1652): allow `bb.edn` to be empty +- [#1586](https://github.com/babashka/babashka/issues/1586): warn when config file doesn't exist and `--debug` is enabled ## 1.3.186 (2023-11-02) diff --git a/src/babashka/main.clj b/src/babashka/main.clj index dff681ae..442a4eed 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -1145,14 +1145,18 @@ Use bb run --help to show this help output. args) [args opts] (parse-global-opts args) ;; TODO: drop jar file from opts - [args {:keys [jar file config merge-deps] :as opts}] + [args {:keys [jar file config merge-deps debug] :as opts}] (if-not (or (:file opts) (:jar opts)) (parse-file-opt args opts) [args opts]) abs-path #(-> % io/file .getAbsolutePath) config (cond - config (when (fs/exists? config) (abs-path config)) + config (if (fs/exists? config) (abs-path config) + (when debug + (binding [*out* *err*] + (println "[babashka] WARNING: config file does not exist:" config)) + nil)) jar (some-> [jar] cp/new-loader (cp/resource "META-INF/bb.edn") .toString) :else (if (and file (fs/exists? file)) ;; file relative to bb.edn