[wip] `make testground` should work when working tree is clean

This commit is contained in:
Michael Bradley, Jr 2022-09-05 16:06:49 -05:00 committed by Dmitriy Ryajov
parent 93270e0649
commit 70f0d87ac0
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 3 additions and 3 deletions

View File

@ -141,9 +141,9 @@ TESTGROUND_TESTCASE ?= hello
testground:
mkdir -p scratch && rm -rf scratch/* && git clone --depth=1 "file://$${PWD}" "scratch/$$(basename $${PWD})"
git diff --merge-base HEAD > "scratch/$$(basename $${PWD})/scratch.patch"
cd "scratch/$$(basename $${PWD})" && git apply scratch.patch
rm "scratch/$$(basename $${PWD})/scratch.patch"
[[ $$(git status --porcelain) == "" ]] || (git diff --merge-base HEAD > "scratch/$$(basename $${PWD})/scratch.patch")
[[ $$(git status --porcelain) == "" ]] || (cd "scratch/$$(basename $${PWD})" && git apply scratch.patch)
rm -f "scratch/$$(basename $${PWD})/scratch.patch"
git clean -ndfx | grep -v $(SCRATCH_IGNORE) | awk '{ print $$3 }' | xargs -I{} bash -c "test -d '{}' && echo '{}' || true" | xargs -I{} mkdir -p scratch/nim-codex/{}
git clean -ndfx | grep -v $(SCRATCH_IGNORE) | awk '{ print $$3 }' | xargs -I{} cp -R {} scratch/nim-codex/{}
testground plan import --from=testground/$(TESTGROUND_PLAN)