Make test-checks.sh helpful and cargo-for-all-lock-files.sh useful (#10906)
This commit is contained in:
parent
8d951776ab
commit
d8106ab552
|
@ -36,8 +36,9 @@ if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
check_status=$?
|
check_status=$?
|
||||||
echo "Some Cargo.lock might be outdated; update them (or just be a compilation error?)"
|
echo "$0: Some Cargo.lock might be outdated; sync them (or just be a compilation error?)" >&2
|
||||||
echo "protip: you can use ./scripts/cargo-for-all-lock-files.sh [check|update] ..."
|
echo "$0: protip: $ ./scripts/cargo-for-all-lock-files.sh [--ignore-exit-code] ... \\" >&2
|
||||||
|
echo "$0: [tree (for outdated Cargo.lock sync)|check (for compilation error)|update -p foo --precise x.y.z (for your Cargo.toml update)] ..." >&2
|
||||||
exit "$check_status"
|
exit "$check_status"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
@ -8,6 +8,9 @@ while [[ -n $1 ]]; do
|
||||||
escape_marker=found
|
escape_marker=found
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
|
elif [[ $1 = "--ignore-exit-code" ]]; then
|
||||||
|
ignore=1
|
||||||
|
shift
|
||||||
else
|
else
|
||||||
shifted_args+=("$1")
|
shifted_args+=("$1")
|
||||||
shift
|
shift
|
||||||
|
@ -33,9 +36,17 @@ for lock_file in $files; do
|
||||||
if [[ -n $CI ]]; then
|
if [[ -n $CI ]]; then
|
||||||
echo "--- [$lock_file]: cargo " "${shifted_args[@]}" "$@"
|
echo "--- [$lock_file]: cargo " "${shifted_args[@]}" "$@"
|
||||||
fi
|
fi
|
||||||
(
|
|
||||||
set -x
|
if (set -x && cd "$(dirname "$lock_file")" && cargo "${shifted_args[@]}" "$@"); then
|
||||||
cd "$(dirname "$lock_file")"
|
# noop
|
||||||
cargo "${shifted_args[@]}" "$@"
|
true
|
||||||
)
|
else
|
||||||
|
failed_exit_code=$?
|
||||||
|
if [[ -n $ignore ]]; then
|
||||||
|
echo "$0: WARN: ignoring last cargo command failed exit code as requested:" $failed_exit_code
|
||||||
|
true
|
||||||
|
else
|
||||||
|
exit $failed_exit_code
|
||||||
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue