Skip to content

Commit 8b65f24

Browse files
committed
chore(ci): improve cargo-install recipe
1 parent cfdb3c6 commit 8b65f24

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

justfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ features_flag := '--all-features'
99
ci_mode := if env('CI', '') != '' {'1'} else {''}
1010
# cargo-binstall needs a workaround due to caching
1111
# ci_mode might be manually set by user, so re-check the env var
12-
binstall_args := if env('CI', '') != '' {'--no-track --disable-telemetry'} else {''}
12+
binstall_args := if env('CI', '') != '' {'--no-confirm --no-track --disable-telemetry'} else {''}
1313
export RUSTFLAGS := env('RUSTFLAGS', if ci_mode == '1' {'-D warnings'} else {''})
1414
export RUSTDOCFLAGS := env('RUSTDOCFLAGS', if ci_mode == '1' {'-D warnings'} else {''})
1515
export RUST_BACKTRACE := env('RUST_BACKTRACE', if ci_mode == '1' {'1'} else {''})
@@ -151,11 +151,14 @@ cargo-install $COMMAND $INSTALL_CMD='' *args='':
151151
#!/usr/bin/env bash
152152
set -euo pipefail
153153
if ! command -v $COMMAND > /dev/null; then
154+
echo "$COMMAND could not be found. Installing..."
154155
if ! command -v cargo-binstall > /dev/null; then
155-
echo "$COMMAND could not be found. Installing it with cargo install ${INSTALL_CMD:-$COMMAND} --locked {{args}}"
156+
set -x
156157
cargo install ${INSTALL_CMD:-$COMMAND} --locked {{args}}
158+
{ set +x; } 2>/dev/null
157159
else
158-
echo "$COMMAND could not be found. Installing it with cargo binstall ${INSTALL_CMD:-$COMMAND} {{binstall_args}} --locked {{args}}"
160+
set -x
159161
cargo binstall ${INSTALL_CMD:-$COMMAND} {{binstall_args}} --locked {{args}}
162+
{ set +x; } 2>/dev/null
160163
fi
161164
fi

0 commit comments

Comments
 (0)