Fix update crates when removing from Cargo.lock
@@ -150,14 +150,14 @@ main() {
echo -e "\n--------------------------------------------------------"
echo -e "### Crates updates for *Cargo.lock*\n"
cargo update --color always -vv 2>&1 |
- (grep -v "crates.io index" || true) |
+ (grep -Ev "crates.io index|Removing" || true) |
tr -s ' ' |
sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" |
sed "s/ Updating //g" |
sed "s/->//g" > "${updated_lock_file}"
while read -r crate actual_version last_version ; do
- formated_actual_version=$(echo "${actual_version}" | grep --only-matching --extended-regexp "[0-9].*.[0-9].*.[0-9]")
- formated_last_version=$(echo "${last_version}" | grep --only-matching --extended-regexp "[0-9].*.[0-9].*.[0-9]")
+ formated_actual_version=$(echo "${actual_version}" | (grep --only-matching --extended-regexp "[0-9].*.[0-9].*.[0-9]" || true))
+ formated_last_version=$(echo "${last_version}" | (grep --only-matching --extended-regexp "[0-9].*.[0-9].*.[0-9]" || true))
crate_url="${crates_api_root_url}/${crate}"
echo "- ${crate} ${formated_actual_version} ${color_blue}updated to ${formated_last_version}${color_reset}"
get_crate_github_release_body "${crate_url}" "${last_version}"
