Browse Source

chore: udpate the clean scripto

appflowy 3 years ago
parent
commit
7a7f881d23
2 changed files with 9 additions and 4 deletions
  1. 4 1
      frontend/scripts/clean.sh
  2. 5 3
      frontend/scripts/makefile/tool.toml

+ 4 - 1
frontend/scripts/clean.sh

@@ -4,8 +4,11 @@
 cd rust-lib
 cargo clean
 
+cd ../../shared-lib
+cargo clean
+
 CACHE_FILE=lib-infra/.cache
-if [ -f "$CACHE_FILE" ]; then
+if [ -d "$CACHE_FILE" ]; then
   echo "Remove $CACHE_FILE"
   rm -rf $CACHE_FILE
 fi

+ 5 - 3
frontend/scripts/makefile/tool.toml

@@ -7,7 +7,11 @@ script = [
     cd ../../shared-lib
     cargo clean
 
-    rm -rf lib-infra/.cache
+    CACHE_FILE=lib-infra/.cache
+    if [ -d "$CACHE_FILE" ]; then
+      echo "Remove $CACHE_FILE"
+      rm -rf $CACHE_FILE
+    fi
   """,
 ]
 script_runner = "@shell"
@@ -19,8 +23,6 @@ script = [
     cargo clean
 
     cd ../../shared-lib
-    cargo clean
-
     rmdir /s/q "lib-infra/.cache"
   """,
 ]