Skip to content

Commit 345cc49

Browse files
committed
chore(ci): improve cargo-install recipe
1 parent 23dbbc2 commit 345cc49

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
@@ -11,7 +11,7 @@ sqlite3 := 'sqlite3'
1111
ci_mode := if env('CI', '') != '' {'1'} else {''}
1212
# cargo-binstall needs a workaround due to caching
1313
# ci_mode might be manually set by user, so re-check the env var
14-
binstall_args := if env('CI', '') != '' {'--no-track --disable-telemetry'} else {''}
14+
binstall_args := if env('CI', '') != '' {'--no-confirm --no-track --disable-telemetry'} else {''}
1515
export RUSTFLAGS := env('RUSTFLAGS', if ci_mode == '1' {'-D warnings'} else {''})
1616
export RUSTDOCFLAGS := env('RUSTDOCFLAGS', if ci_mode == '1' {'-D warnings'} else {''})
1717
export RUST_BACKTRACE := env('RUST_BACKTRACE', if ci_mode == '1' {'1'} else {''})
@@ -206,12 +206,15 @@ cargo-install $COMMAND $INSTALL_CMD='' *args='':
206206
#!/usr/bin/env bash
207207
set -euo pipefail
208208
if ! command -v $COMMAND > /dev/null; then
209+
echo "$COMMAND could not be found. Installing..."
209210
if ! command -v cargo-binstall > /dev/null; then
210-
echo "$COMMAND could not be found. Installing it with cargo install ${INSTALL_CMD:-$COMMAND} --locked {{args}}"
211+
set -x
211212
cargo install ${INSTALL_CMD:-$COMMAND} --locked {{args}}
213+
{ set +x; } 2>/dev/null
212214
else
213-
echo "$COMMAND could not be found. Installing it with cargo binstall ${INSTALL_CMD:-$COMMAND} {{binstall_args}} --locked {{args}}"
215+
set -x
214216
cargo binstall ${INSTALL_CMD:-$COMMAND} {{binstall_args}} --locked {{args}}
217+
{ set +x; } 2>/dev/null
215218
fi
216219
fi
217220

0 commit comments

Comments
 (0)