mirror of
https://github.com/NinjaTrappeur/my-repo-pins.git
synced 2024-06-19 20:06:20 +02:00
Félix Baylac-Jacqué
a768efebba
git clone is creating a destination empty directory before even attempting to clone the remote URL. It means that if the user-supplied remote URL happen to be invalid, an empty directory is getting created at dest, preventing us to try cloning the same repository once again. We fixed that issue by checking whether the remote git repository exists using git ls-remote **before** calling git clone. git ls-remote will fail on a git repository not containing any git commit. We add a function to the test bed creating a git repo with one commit. It's a bit hacky, but that's the best setup I could come with. We embed a dummy git repo to the my-repo-pins codebase and copy it during the test phase to a tmp workspace.
36 lines
1 KiB
Makefile
36 lines
1 KiB
Makefile
# Makefile *shamelessly stolen* from https://github.com/purcell/envrc.
|
|
# I love the simplicity of it.
|
|
# Thanks Steve <3
|
|
|
|
EMACS ?= emacs
|
|
|
|
# A space-separated list of required package names
|
|
NEEDED_PACKAGES = package-lint seq inheritenv ert-async
|
|
|
|
INIT_PACKAGES="(progn \
|
|
(require 'package) \
|
|
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \
|
|
(package-initialize) \
|
|
(dolist (pkg '(${NEEDED_PACKAGES})) \
|
|
(unless (package-installed-p pkg) \
|
|
(unless (assoc pkg package-archive-contents) \
|
|
(package-refresh-contents)) \
|
|
(package-install pkg))) \
|
|
)"
|
|
|
|
all: compile test package-lint clean-elc
|
|
|
|
test:
|
|
${EMACS} -Q --eval ${INIT_PACKAGES} --batch -l my-repo-pins.el -l my-repo-pins-tests.el -f ert-run-tests-batch-and-exit
|
|
|
|
package-lint:
|
|
${EMACS} -Q --eval ${INIT_PACKAGES} --batch -f package-lint-batch-and-exit my-repo-pins.el
|
|
|
|
compile: clean-elc
|
|
${EMACS} -Q --eval ${INIT_PACKAGES} -L . --batch -f batch-byte-compile *.el
|
|
|
|
clean:
|
|
rm -f f.elc
|
|
|
|
.PHONY: all compile clean-elc package-lint test
|