1
0
Fork 0
mirror of synced 2024-11-04 09:08:56 -05:00

Use local version of yadm by default (in testhost/scripthost)

Also symlink instead of copy in that case, so that changes locally can
be reflected in the testhost directly, and print the used version in a
more readable format.
This commit is contained in:
Erik Flodin 2021-01-02 00:05:00 +01:00
parent dcfa55ce49
commit f67189c6b7
No known key found for this signature in database
GPG key ID: 420A7C865EE3F85F

View file

@ -23,11 +23,10 @@ usage:
@echo
@echo ' make testhost [version=VERSION]'
@echo ' - Create an ephemeral container for doing adhoc yadm testing. The'
@echo ' HEAD revision of yadm will be used unless "version" is'
@echo ' working copy version of yadm will be used unless "version" is'
@echo ' specified. "version" can be set to any commit, branch, tag, etc.'
@echo ' The targeted "version" will be retrieved from the repo, and'
@echo ' linked into the container as a local volume. Setting version to'
@echo ' "local" uses yadm from the current working tree.'
@echo ' linked into the container as a local volume.'
@echo
@echo ' make scripthost [version=VERSION]'
@echo ' - Create an ephemeral container for demonstrating a bug. After'
@ -103,13 +102,15 @@ test:
fi
.PHONY: .testyadm
.testyadm: version ?= HEAD
.testyadm: version ?= local
.testyadm:
@echo "Using yadm version=\"$(version)\""
@rm -f $@
@if [ "$(version)" = "local" ]; then \
cp -f yadm $@; \
ln -sf yadm $@; \
echo "Using local yadm ($$(git describe --tags --dirty))"; \
else \
git show $(version):yadm > $@; \
echo "Using yadm version $$(git describe --tags $(version))"; \
fi
@chmod a+x $@