solana/.buildkite/hooks/pre-command

14 lines
265 B
Bash
Executable File

#!/bin/bash -e
[[ -n "$CARGO_TARGET_CACHE_NAME" ]] || exit 0
#
# Restore target/ from the previous CI build on this machine
#
(
d=$HOME/cargo-target-cache/"$CARGO_TARGET_CACHE_NAME"
mkdir -p $d/target
set -x
rsync -a --delete --link-dest=$d $d/target .
)