build(update.sh): Don't always perform the expensive `upgrade`

This commit is contained in:
Benedikt Peetz 2024-05-19 14:06:04 +02:00
parent c6dc9db2e8
commit ee8e860789
Signed by: bpeetz
GPG Key ID: B6139BCB07CE946D
1 changed files with 7 additions and 2 deletions

View File

@ -19,9 +19,14 @@
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
cargo update && cargo upgrade
update() {
[ "$1" = "upgrade" ] && cargo upgrade
cargo update
}
update "$@"
cd ./example/main || {
echo "Main example is missing"
exit 1
}
cargo update && cargo upgrade
update "$@"