Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - DESTDIR variable in Makefile #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GOARCH := $(shell echo $(PLATFORM) | cut -d "/" -f 2)
SUFFIX := $(GOOS)-$(GOARCH)
VERSION ?= $(shell git describe --always --tags --dirty)
BUILD_FLAGS := -ldflags="-s -w -X github.com/nicklasfrahm/$(TARGET)/cmd.version=$(VERSION)"
DESTDIR := /usr/local/bin

# Adjust the binary name on Windows.
ifeq ($(GOOS),windows)
Expand All @@ -29,16 +30,15 @@ vagrant-up:
vagrant-down:
cd deploy/vagrant; vagrant destroy -f

/usr/local/bin/$(TARGET): bin/$(TARGET)-$(SUFFIX)
@sudo cp $^ $@
@sudo chmod 755 $@
$(DESTDIR)/$(TARGET): bin/$(TARGET)-$(SUFFIX)
sudo install -Dm 755 $^ $@

.PHONY: install
install: /usr/local/bin/$(TARGET)
install: $(DESTDIR)/$(TARGET)

.PHONY: uninstall
uninstall:
@sudo rm -f /usr/local/bin/$(TARGET)
@sudo rm -f $(DESTDIR)/$(TARGET)

.PHONY: docker
docker:
Expand Down
1 change: 1 addition & 0 deletions pkg/engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (c *Config) Verify() error {
return errors.New("configuration empty")
}

// TODO: Also allow versions in the format of `v1.24.4+k3s1`.
channelValid := false
for _, channel := range Channels {
if channel == c.Version {
Expand Down