Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 3740589

Browse files
authored
Cache rust artifacts only when cargo files are detected
This way we don't turn the `target` directory into a reserved directory if people are not using rust.
1 parent e1ca735 commit 3740589

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

run-build-functions.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,13 @@ cache_artifacts() {
685685
cache_home_directory ".boot" "boot dependencies"
686686
cache_home_directory ".composer" "composer dependencies"
687687
cache_home_directory ".homebrew-cache", "homebrew cache"
688-
cache_home_directory ".rustup" "rust rustup cache"
689-
cache_home_directory ".cargo/registry" "rust cargo registry cache"
690-
cache_home_directory ".cargo/bin" "rust cargo bin cache"
688+
689+
if if [ -f Cargo.toml ] || [ -f Cargo.lock ]
690+
then
691+
cache_home_directory ".rustup" "rust rustup cache"
692+
cache_home_directory ".cargo/registry" "rust cargo registry cache"
693+
cache_home_directory ".cargo/bin" "rust cargo bin cache"
694+
fi
691695

692696
# Don't follow the Go import path or we'll store
693697
# the origin repo twice.

0 commit comments

Comments
 (0)