summaryrefslogtreecommitdiffstats
path: root/bin/.bin/reply
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-02-27 22:29:09 -0500
committerJesse Luehrs <doy@tozt.net>2024-02-27 22:29:09 -0500
commitd5e72ac1b3d1aacec097c1d41decbe748c035f06 (patch)
treee75f879e5cdf3b51eb23ab321eb6e8ec2ce6ea9a /bin/.bin/reply
parent0179eebc614a5668048b510cb7a0776354c16dc3 (diff)
downloadconf-d5e72ac1b3d1aacec097c1d41decbe748c035f06.tar.gz
conf-d5e72ac1b3d1aacec097c1d41decbe748c035f06.zip
rearrange some more things
Diffstat (limited to 'bin/.bin/reply')
-rwxr-xr-xbin/.bin/reply28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/.bin/reply b/bin/.bin/reply
new file mode 100755
index 0000000..412189f
--- /dev/null
+++ b/bin/.bin/reply
@@ -0,0 +1,28 @@
+#!/bin/sh
+set -eu
+
+DOCKERFILE="$(cat <<EOF
+FROM docker.io/debian:stable-slim
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ cpanminus \
+ make \
+ gcc \
+ libreadline-dev
+RUN cpanm -n \
+ Reply \
+ B::Keywords \
+ Data::Dump \
+ Carp::Always \
+ Term::ReadLine::Gnu
+EOF
+)"
+IMAGE="$(basename "$0"):$(echo "$DOCKERFILE" | sha256sum | cut -d' ' -f1)"
+
+if [ -z "$(podman images -q "$IMAGE")" ]; then
+ echo "$DOCKERFILE" | podman build -t "$IMAGE" -f - .
+fi
+
+podman run --rm -it \
+ -v "$HOME"/.replyrc:/root/.replyrc \
+ "$IMAGE" \
+ reply "$@"