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 527727cbd3
commit 5d3afa3c5a
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. # and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>. # If not, see <https://www.gnu.org/licenses/>.
cargo update && cargo upgrade update() {
[ "$1" = "upgrade" ] && cargo upgrade
cargo update
}
update "$@"
cd ./example/main || { cd ./example/main || {
echo "Main example is missing" echo "Main example is missing"
exit 1 exit 1
} }
cargo update && cargo upgrade update "$@"