lint: Fix cargo patches linter when no patches are present

This commit is contained in:
Jack Grigg 2022-05-12 11:19:52 +00:00
parent aeea89f704
commit 7b17b6f666
1 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,10 @@ CONFIG_FILE="$REPOBASE/.cargo/config.offline"
CARGO_TOML_PATCH_PREFIX="[patch.crates-io]"
let CARGO_TOML_PATCH_START=$(grep -Fn "$CARGO_TOML_PATCH_PREFIX" $CARGO_TOML | cut -d: -f1)+1
if [ "$CARGO_TOML_PATCH_START" -eq 1 ]; then
# We have no patched dependencies to lint.
exit
fi
REPLACE_LINE="replace-with = \"vendored-sources\""