mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-27 02:12:45 +03:00
5f1bb2a8fc
This is required by a later commit that introduces flakes-based test evaluation. Evaluating local flakes needs a repo dir.
22 lines
628 B
Bash
22 lines
628 B
Bash
# Re-run run-tests.sh in a snapshot copy of the source.
|
|
# Maintain /tmp/nix-bitcoin-src as a source cache to minimize copies.
|
|
|
|
tmp=$(mktemp -d '/tmp/nix-bitcoin-src.XXXXX')
|
|
|
|
# Move source cache if it exists (atomic)
|
|
mv /tmp/nix-bitcoin-src "$tmp/src" 2>/dev/null || true
|
|
|
|
atExit() {
|
|
# Set the current src as the source cache (atomic)
|
|
mv -T "$tmp/src" /tmp/nix-bitcoin-src 2>/dev/null || true
|
|
rm -rf "$tmp"
|
|
}
|
|
trap "atExit" EXIT
|
|
|
|
# shellcheck disable=SC2154
|
|
rsync -a --delete "$scriptDir/../" "$tmp/src"
|
|
echo "Copied src"
|
|
|
|
# shellcheck disable=SC2154
|
|
_nixBitcoinInCopiedSrc=1 "$tmp/src/test/run-tests.sh" "${args[@]}"
|