From 63d7148afc56cc5531d6efbc57f8e14bd1c38153 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Wed, 30 Oct 2024 14:47:47 -0600 Subject: [PATCH] [sc-39654] Add ghciwatch --- Dockerfile | 6 +++--- install-tools.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02f17f6..d6bf399 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,6 @@ ARG BOOTSTRAP_HASKELL_MINIMAL=1 ARG BOOTSTRAP_HASKELL_NONINTERACTIVE=1 ENV GHCUP_INSTALL_BASE_PREFIX=/usr/local -ADD install-tools.sh /install-tools.sh - RUN apt-get update \ && apt-get install -qq -y --no-install-recommends \ curl build-essential git-all libffi-dev libffi8 libgmp-dev \ @@ -45,4 +43,6 @@ ARG CABAL_VERSION RUN ghcup install cabal $CABAL_VERSION --set ADD stack.yaml /stack.yaml -RUN /bin/sh /install-tools.sh + +ADD install-tools.sh /install-tools.sh +RUN bash /install-tools.sh diff --git a/install-tools.sh b/install-tools.sh index 17e38b7..72af79a 100644 --- a/install-tools.sh +++ b/install-tools.sh @@ -1,5 +1,16 @@ set -o errexit +arch=$(uname -m) +if [[ $arch == x86_64 ]]; then + curl -Lo /usr/local/bin/ghciwatch "https://github.com/MercuryTechnologies/ghciwatch/releases/download/v1.0.1/ghciwatch-x86_64-linux" +elif [[ $arch == aarch64 ]]; then + curl -Lo /usr/local/bin/ghciwatch "https://github.com/MercuryTechnologies/ghciwatch/releases/download/v1.0.1/ghciwatch-aarch64-linux" +else + echo "install-tools.sh: Unknown architecture $arch" + exit 1 +fi +chmod +x /usr/local/bin/ghciwatch + stack install \ --local-bin-path /usr/local/bin \ weeder \