Skip to content

Commit c1c1de0

Browse files
Replace rlwrap with rlfe
1 parent 3ee0739 commit c1c1de0

File tree

3 files changed

+18
-38
lines changed

3 files changed

+18
-38
lines changed

resources/clj.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# This script acts as a replacement for "clj" script shipped with Clojure CLI
4+
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
5+
# and provide line editing abilities. This script uses rlfe instead of rlwrap
6+
# for the same purpose. If rlfe is not installed, run regular "clojure" script.
7+
8+
if type rlfe; then
9+
exec rlfe clojure "$@"
10+
else
11+
exec clojure "$@"
12+
fi

resources/rlwrap.retry

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/docker_clojure/dockerfile/tools_deps.clj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
install-distro-deps uninstall-distro-build-deps]]))
55

66
(defn prereqs [dir _variant]
7-
(copy-resource-file! dir "rlwrap.retry" identity
7+
(copy-resource-file! dir "clj.sh" identity
88
#(.setExecutable % true false)))
99

1010
(def distro-deps
1111
{:debian-slim {:build #{"curl"}
12-
:runtime #{"rlwrap" "make" "git"}}
12+
:runtime #{"rlfe" "make" "git"}}
1313
:debian {:build #{"curl"}
14-
:runtime #{"rlwrap" "make" "git"}}
14+
:runtime #{"rlfe" "make" "git"}}
1515
:ubuntu {:build #{}
1616
;; install curl as a runtime dep b/c we need it at build time
1717
;; but upstream includes it so we don't want to uninstall it
18-
:runtime #{"rlwrap" "make" "git" "curl"}}
18+
:runtime #{"rlfe" "make" "git" "curl"}}
1919
:alpine {:build #{"curl"}
2020
:runtime #{"bash" "make" "git"}}})
2121

@@ -24,9 +24,7 @@
2424
(def uninstall-build-deps (partial uninstall-distro-build-deps distro-deps))
2525

2626
(def docker-bug-notice
27-
["# Docker bug makes rlwrap crash w/o short sleep first"
28-
"# Bug: https://github.com/moby/moby/issues/28009"
29-
"# As of 2021-09-10 this bug still exists, despite that issue being closed"])
27+
["# Custom \"clj\" script that uses rlfe instead of rlwrap"])
3028

3129
(defn install [installer-hashes {:keys [build-tool-version] :as variant}]
3230
(let [install-dep-cmds (install-deps variant)
@@ -47,7 +45,7 @@
4745
"clojure -e \"(clojure-version)\""] (empty? uninstall-dep-cmds))
4846
(concat-commands uninstall-dep-cmds :end)
4947
(concat [""] docker-bug-notice
50-
["COPY rlwrap.retry /usr/local/bin/rlwrap"])
48+
["COPY clj.sh /usr/local/bin/clj"])
5149
(->> (remove nil?)))))
5250

5351
(defn command [{:keys [jdk-version]}]

0 commit comments

Comments
 (0)