refactor: clean script

This commit is contained in:
appflowy
2022-06-19 09:42:25 +08:00
parent 370072dafb
commit 824c7c0e8d
4 changed files with 24 additions and 54 deletions

View File

@ -1,29 +1,35 @@
[tasks.rust_clean]
run_task = { name = ["cargo_clean","rm_macro_build_cache", "rm_generated_protobuf_files"] }
[tasks.cargo_clean]
script = [
"""
cd rust-lib
cargo clean
cargo clean -q
cd ../../shared-lib
cargo clean
CACHE_FILE=lib-infra/.cache
if [ -d "$CACHE_FILE" ]; then
echo "Remove $CACHE_FILE"
rm -rf $CACHE_FILE
fi
cargo clean -q
""",
]
script_runner = "@shell"
[tasks.rust_clean.windows]
[tasks.rm_macro_build_cache]
script = [
"""
path = canonicalize ../shared-lib/lib-infra/.cache
if is_path_exists ${path}
rm -rf ${path}
end
""",
]
script_runner = "@duckscript"
[tasks.rm_generated_protobuf_files]
script = [
"""
cd rust-lib
cargo clean
cd ../../shared-lib
rmdir /s/q "lib-infra/.cache"
""",
]
script_runner = "@duckscript"