Skip to content

Commit

Permalink
Merge pull request yadm-dev#288 from erijo/testyadm-version
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLocehiliosan committed Jan 2, 2021
2 parents dcfa55c + f67189c commit 0675bc9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 $@

Expand Down

0 comments on commit 0675bc9

Please sign in to comment.