Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy: always create the capture file for Clippy #173

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/inject-clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
ORIGINAL_LOCATION="/usr/bin/cargo"
NEW_LOCATION="/usr/bin/cargo_original"

if [ -f "$NEW_LOCATION" ]; then
# remove capture file created by previous runs if --skip-init is in effect
rm -fv "/builddir/clippy-output.txt"
# create empty or truncate existing (if --skip-init is in effect) capture file
runuser mockbuild -c "truncate --size=0 /builddir/clippy-output.txt"

if [ -x "$NEW_LOCATION" ]; then
# binary already moved (most likely by a previous run of this script)
exit 0
fi

Expand Down