Use short option for macOS compatibility.

This commit is contained in:
jcamiel 2022-01-24 14:19:32 +01:00 committed by lepapareil
parent 771fc97dc3
commit ca14e77619

View File

@ -26,7 +26,7 @@ for package in packages/* ; do
fi fi
else else
if [ "$1" = "--update" ] ; then if [ "$1" = "--update" ] ; then
sed --in-place "s/${dependency}.*=.*\"${actual_version}\"/${dependency} = \"${last_version}\"/g" "${package}/Cargo.toml" sed -i" " "s/${dependency}.*=.*\"${actual_version}\"/${dependency} = \"${last_version}\"/g" "${package}/Cargo.toml"
grep --silent "${dependency} = \"${last_version}\"" "${package}/Cargo.toml" && \ grep --silent "${dependency} = \"${last_version}\"" "${package}/Cargo.toml" && \
echo "${color_blue}old, updated to ${last_version}${color_reset}" || \ echo "${color_blue}old, updated to ${last_version}${color_reset}" || \
echo "${color_red}error, update to ${last_version} fails, please check ${package}/Cargo.toml format and syntax${color_reset}" echo "${color_red}error, update to ${last_version} fails, please check ${package}/Cargo.toml format and syntax${color_reset}"
@ -36,7 +36,7 @@ for package in packages/* ; do
((exit_code++)) ((exit_code++))
fi fi
done < <(sed --silent "/dependencies\]/,/^$/p" "${package}/Cargo.toml" | grep --extended-regexp --invert-match "\[|path|^$" | tr --delete '" ' | tr '=' ' ') done < <(sed -n "/dependencies\]/,/^$/p" "${package}/Cargo.toml" | grep --extended-regexp --invert-match "\[|path|^$" | tr -d '" ' | tr '=' ' ')
done done
if [ "$1" != "--update" ] && [ "${exit_code}" -gt 0 ] ; then if [ "$1" != "--update" ] && [ "${exit_code}" -gt 0 ] ; then