Base Templates

This commit is contained in:
2025-12-10 20:39:40 +01:00
commit 10dfdd5605
7 changed files with 120 additions and 0 deletions
+8
View File
@@ -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
+17
View File
@@ -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
+13
View File
@@ -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
+22
View File
@@ -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)