From 43281c4dd34d9584968de45e27d8344b0256b50a Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Mon, 7 Aug 2023 16:20:18 -0400 Subject: [PATCH] Improve the clean command --- build.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 39d8763..dc26d8b 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,20 @@ set -euo pipefail -RUST_ALL_TARGETS="dashboard ifc memorycache geo-types fluent-ergonomics cyberpunk-splash screenplay emseries coordinates flow sgf changeset" +RUST_ALL_TARGETS=( + "dashboard" + "ifc" + "memorycache" + "geo-types" + "fluent-ergonomics" + "cyberpunk-splash" + "screenplay" + "emseries" + "coordinates" + "flow" + "sgf" + "changeset" +) build_rust_targets() { local CMD=$1 @@ -23,8 +36,13 @@ if [ -z "${CMD-}" ]; then CMD="release" fi +if [ "${CMD}" == "clean" ]; then + cargo clean + exit 0 +fi + if [ "${TARGET}" == "all" ]; then - build_rust_targets $CMD $RUST_ALL_TARGETS + build_rust_targets $CMD ${RUST_ALL_TARGETS[*]} else build_rust_targets $CMD $TARGET fi