From d3fa5cb9540227cbe156f2c27516873ff7465150 Mon Sep 17 00:00:00 2001 From: bootleq Date: Wed, 25 May 2022 17:30:43 +0800 Subject: [PATCH 1/3] Avoid add M exec-opt twice If user explicitly specify `-M:xxx` option to e.g., add some aliases, we should just take it instead of build second `-M` in MAIN_FLAG. --- bin/iced | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/iced b/bin/iced index 47c4cb83..241eb0bb 100755 --- a/bin/iced +++ b/bin/iced @@ -402,7 +402,11 @@ case "$1" in CLOJURE_CLI_VERSION=$(clojure -Sdescribe | head -1 | cut -d' ' -f2 | tr -d '"') MIN_MAIN_VERSION="1.10.1.672" if [ "$(printf '%s\n' "$MIN_MAIN_VERSION" "$CLOJURE_CLI_VERSION" | sort -V | head -n1)" = "$MIN_MAIN_VERSION" ]; then - MAIN_FLAG="-M -m" + if [[ "$OPTIONS" =~ "-M:" ]]; then + MAIN_FLAG="-m" + else + MAIN_FLAG="-M -m" + fi else MAIN_FLAG="-m" fi From e4377231aeb7375d34fc819c1616efa7e51223b0 Mon Sep 17 00:00:00 2001 From: bootleq Date: Thu, 26 May 2022 20:10:58 +0800 Subject: [PATCH 2/3] Should update template file The `bin/iced` file is made (`make bin`) from this template. Previous commit missed to update this source. --- clj/template/iced.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clj/template/iced.bash b/clj/template/iced.bash index bdc6ac3b..ccb3e816 100755 --- a/clj/template/iced.bash +++ b/clj/template/iced.bash @@ -402,7 +402,11 @@ case "$1" in CLOJURE_CLI_VERSION=$(clojure -Sdescribe | head -1 | cut -d' ' -f2 | tr -d '"') MIN_MAIN_VERSION="1.10.1.672" if [ "$(printf '%s\n' "$MIN_MAIN_VERSION" "$CLOJURE_CLI_VERSION" | sort -V | head -n1)" = "$MIN_MAIN_VERSION" ]; then - MAIN_FLAG="-M -m" + if [[ "$OPTIONS" =~ "-M:" ]]; then + MAIN_FLAG="-m" + else + MAIN_FLAG="-M -m" + fi else MAIN_FLAG="-m" fi From e5fedaabce5d5b8fcea6f4b59187436c1f91b366 Mon Sep 17 00:00:00 2001 From: bootleq Date: Fri, 27 May 2022 14:25:57 +0800 Subject: [PATCH 3/3] Add warning comment to template This would give further contributor a hint, must make change to template. --- bin/iced | 4 ++++ clj/template/iced.bash | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bin/iced b/bin/iced index 241eb0bb..43967e70 100755 --- a/bin/iced +++ b/bin/iced @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# === WARNING === +# bin/iced is generated by `make bin`. +# Please edit clj/template/iced.bash instead of bin/iced. + CWD=$(pwd) SCRIPT_DIR=$(cd $(dirname $0); pwd) PROJECT_DIR=$(cd $SCRIPT_DIR; cd ..; pwd) diff --git a/clj/template/iced.bash b/clj/template/iced.bash index ccb3e816..7430131d 100755 --- a/clj/template/iced.bash +++ b/clj/template/iced.bash @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# === WARNING === +# bin/iced is generated by `make bin`. +# Please edit clj/template/iced.bash instead of bin/iced. + CWD=$(pwd) SCRIPT_DIR=$(cd $(dirname $0); pwd) PROJECT_DIR=$(cd $SCRIPT_DIR; cd ..; pwd)