From 644342070fc1925955fb5c850b00a765cd3ad413 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 19 May 2024 14:06:04 +0200 Subject: [PATCH] build(update.sh): Don't always perform the expensive `upgrade` --- update.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/update.sh b/update.sh index 8e07ddb..4019ff9 100755 --- a/update.sh +++ b/update.sh @@ -19,9 +19,14 @@ # and the Lesser GNU General Public License along with this program. # If not, see . -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 "$@"