Merge #322: run-tests: Fix interrupt handling for --copy-src
8e3feece67
run-tests: fix interrupt handling for --copy-src (Erik Arvstedt) Pull request description: ACKs for top commit: nixbitcoin: ACK8e3feece67
Tree-SHA512: ec4916facedb1f5988dccd0e80e08fcf1788a8425320676e6c48350aa69f29d302bb102408c52c748ac5a794735c0c00d7a95dbea91d735add40b5690817d272
This commit is contained in:
commit
eddc48ee62
@ -3,16 +3,16 @@
|
||||
|
||||
tmp=$(mktemp -d '/tmp/nix-bitcoin-src.XXXXX')
|
||||
|
||||
# Ignore errors from now on
|
||||
set +e
|
||||
|
||||
# Move source cache if it exists (atomic)
|
||||
mv /tmp/nix-bitcoin-src $tmp/src 2>/dev/null
|
||||
|
||||
rsync -a --delete --exclude='.git*' "$scriptDir/../" $tmp/src && \
|
||||
echo "Copied src" && \
|
||||
_nixBitcoinInCopySrc=1 $tmp/src/test/run-tests.sh "${args[@]}"
|
||||
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
|
||||
mv -T $tmp/src /tmp/nix-bitcoin-src 2>/dev/null || true
|
||||
rm -rf $tmp
|
||||
}
|
||||
trap "atExit" EXIT
|
||||
|
||||
rsync -a --delete --exclude='.git*' "$scriptDir/../" $tmp/src
|
||||
echo "Copied src"
|
||||
_nixBitcoinInCopySrc=1 $tmp/src/test/run-tests.sh "${args[@]}"
|
||||
|
Loading…
Reference in New Issue
Block a user