Skip to content

Commit

Permalink
rust: improve error handling of toml/jq install (#24)
Browse files Browse the repository at this point in the history
Chains installation commands together to improve error handling.

The previous code would still catch errors, but the error messages would
be unclear "file not found" errors when running the final chmod commands.
Due to previous exit codes not being checked.

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
  • Loading branch information
alexcb committed Nov 7, 2023
1 parent f8906ce commit 4371143
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ get-tomljson:
FROM alpine:3.18.3
ARG USERARCH
ARG version=2.1.0
RUN wget -O tomljson.tar.xz https://github.com/pelletier/go-toml/releases/download/v${version}/tomljson_${version}_linux_${USERARCH}.tar.xz; \
tar -xf tomljson.tar.xz; \
RUN wget -O tomljson.tar.xz https://github.com/pelletier/go-toml/releases/download/v${version}/tomljson_${version}_linux_${USERARCH}.tar.xz && \
tar -xf tomljson.tar.xz && \
chmod +x tomljson
SAVE ARTIFACT tomljson

Expand All @@ -70,7 +70,7 @@ get-jq:
FROM alpine:3.18.3
ARG USERARCH
ARG version=1.7
RUN wget -O jq https://github.com/jqlang/jq/releases/download/jq-${version}/jq-linux-${USERARCH}; \
RUN wget -O jq https://github.com/jqlang/jq/releases/download/jq-${version}/jq-linux-${USERARCH} && \
chmod +x jq
SAVE ARTIFACT jq

Expand Down

0 comments on commit 4371143

Please sign in to comment.