From 8db8053d230caaf569871b05e37943531824fce9 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 22 Oct 2024 12:30:44 -0500 Subject: [PATCH] make -> swydd --- Makefile | 5 ----- tasks.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) delete mode 100644 Makefile create mode 100755 tasks.py diff --git a/Makefile b/Makefile deleted file mode 100644 index 19a1121..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -build: ## build the image! - podman build . -t daylinbox - --include .task.mk -$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk)) diff --git a/tasks.py b/tasks.py new file mode 100755 index 0000000..1109a38 --- /dev/null +++ b/tasks.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +if not ( + (_i := __import__)("importlib.util").util.find_spec("swydd") + or (_src := _i("pathlib").Path(__file__).parent / "swydd/__init__.py").is_file() +): # noqa | https://github.com/daylinmorgan/swydd?tab=readme-ov-file#automagic-snippet + _r = _i("urllib.request").request.urlopen("https://swydd.dayl.in/swydd.py") + _src.parent.mkdir(exist_ok=True) + _src.write_text(_r.read().decode()) + +from swydd import task, sub, cli + +@task +def build(args: str = ""): + """build the image""" + sub("podman build . -t daylinbox " + args) + +cli()