Skip to content

Commit

Permalink
fix(rust): allow redirection by defering the return fail check
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenj committed May 8, 2024
1 parent 27a6b41 commit f1238b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions earthly/rust/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,15 @@ EXECUTE:
# should be saved regardless.
RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE --mount=$EARTHLY_RUST_TARGET_CACHE \
env | grep EARTHLY; \
set -e; \
set +e; \
rm -f fail; \
$cmd $args1 $args2 $args3 $args4 $args5 $args6 || echo fail > fail; \
$cmd $args1 $args2 $args3 $args4 $args5 $args6 ; \
if [ $? -ne 0 ]; then \
touch fail; \
fi \
cargo sweep -r -t $EARTHLY_SWEEP_DAYS; \
cargo sweep -r -i;
cargo sweep -r -i; \


# We always want to save these (if requested) even if the command fails.
IF [ "$junit" != "" ]
Expand Down

0 comments on commit f1238b9

Please sign in to comment.