diff --git a/Dockerfile b/Dockerfile index 342b1b9..d4b0326 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,11 @@ RUN apt-get update #apt-get install -y git && \ #git clone https://github.com/openHPI/poseidon.git . -COPY . . - # Install make (required for building) RUN apt-get install -y make +COPY . . + # Install required project libraries RUN make bootstrap diff --git a/Makefile b/Makefile index a6c6f7f..eff9632 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,13 @@ tidy-deps: ## Remove unused dependencies .PHONY: git-hooks -git-hooks: .git/hooks/pre-commit ## Install the git-hooks -.git/hooks/%: git_hooks/% - cp $^ $@ - chmod 755 $@ +GIT_HOOKS_DIR := $(shell if [ -f .git ]; then echo $$(cat .git | sed 's/gitdir: //')/hooks; else echo .git/hooks; fi) +git-hooks: $(GIT_HOOKS_DIR)/pre-commit ## Install the git-hooks +$(GIT_HOOKS_DIR)/%: git_hooks/% + @if [ -d "$(GIT_HOOKS_DIR)" ]; then \ + cp $^ $@; \ + chmod 755 $@; \ + fi .PHONY: build build: deps ## Build the binary