mirror of
https://github.com/agresdominik/dev-templates.git
synced 2026-04-21 18:05:49 +00:00
Base Templates
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
.PHONY ...
|
||||
|
||||
DOCKER_NAME = project:name
|
||||
PACKAGES = ./src/.
|
||||
|
||||
docker: # build a dockerfile in same dir and shell into it
|
||||
docker build -t $(DOCKER_NAME) .
|
||||
docker run -it --rm $(DOCKER_NAME) /bin/sh
|
||||
@@ -0,0 +1,17 @@
|
||||
.PHONY ...
|
||||
|
||||
EXECUTABLE = cheatsh
|
||||
PACKAGES = ./src/.
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
@mkdir -p bin
|
||||
go build -o bin/$(EXECUTABLE) $(PACKAGES)
|
||||
|
||||
clean:
|
||||
rm -rf bin/
|
||||
|
||||
docker:
|
||||
docker build -t cheatsh-test .
|
||||
docker run -it --rm cheatsh-test /bin/sh
|
||||
@@ -0,0 +1,13 @@
|
||||
.PHONY: all run test
|
||||
|
||||
SRC := ./src
|
||||
VENV := .venv
|
||||
|
||||
RUNNER := $(VENV)/bin/python
|
||||
TESTER := $(VENV)/bin/pytest
|
||||
|
||||
run:
|
||||
$(RUNNER) $(SRC)/main.py
|
||||
|
||||
test:
|
||||
$(TESTER) $(SRC)/main.py
|
||||
@@ -0,0 +1,22 @@
|
||||
.PHONY ...
|
||||
|
||||
EXECUTABLE = cheatsh
|
||||
PACKAGES = ./src/.
|
||||
SYSCONFDIR = $(HOME)/.config/cheatsh
|
||||
PREFIX ?= $(HOME)/.local
|
||||
|
||||
build:
|
||||
# build block
|
||||
|
||||
install: build
|
||||
|
||||
@echo "Installing binary in $(PREFIX)"
|
||||
install -Dm755 bin/$(EXECUTABLE) $(PREFIX)/bin/$(EXECUTABLE)
|
||||
|
||||
@echo "Copying config files to $(SYSCONFDIR)"
|
||||
install -Dm644 data/commands.json $(SYSCONFDIR)/commands.json
|
||||
install -Dm644 data/commands_template.json $(SYSCONFDIR)/commands_template.json
|
||||
|
||||
uninstall:
|
||||
rm -f $(PREFIX)/bin/$(EXECUTABLE)
|
||||
rm -rf $(SYSCONFDIR)
|
||||
Reference in New Issue
Block a user