summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleš Mrázek <ales.mrazek@nic.cz>2024-08-02 11:53:24 +0200
committerAleš Mrázek <ales.mrazek@nic.cz>2024-08-26 14:28:10 +0200
commit54db0415183519deaad38cf5c6c30c3186800cb9 (patch)
tree6c3af263c66ea4f29ffc603800622bc1b9c97172
parentscripts: make all scripts executable (diff)
downloadknot-resolver-54db0415183519deaad38cf5c6c30c3186800cb9.tar.xz
knot-resolver-54db0415183519deaad38cf5c6c30c3186800cb9.zip
scripts/poe-tasks: kresctl task script added
-rwxr-xr-xpoe2
-rw-r--r--pyproject.toml3
-rwxr-xr-xscripts/poe-tasks/kresctl8
3 files changed, 10 insertions, 3 deletions
diff --git a/poe b/poe
index 29065280..b1fafd95 100755
--- a/poe
+++ b/poe
@@ -19,4 +19,4 @@ else
echo "poethepoet version - must be >=0.22.0" >&2
echo "Python version - must be >=3.8" >&2
exit 1
-fi
+fi \ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 81b7a960..2a4bedf2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -82,8 +82,7 @@ gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.p
format = { cmd = "scripts/poe-tasks/format", help = "Run code formatter" }
# tasks runned directly
fixdeps = { shell = "poetry install; npm install; npm update", help = "Install/update dependencies according to configuration files"}
-kresctl = { script = "knot_resolver_manager.cli.main:main", cwd="${POE_PWD}", help="Run kresctl utility" }
-kresctl-nocwd = { script = "knot_resolver_manager.cli.main:main", help="Run kresctl utility" } # Python <3.8 and poethepoet <0.22.0 compatibility (see also `./poe`)
+kresctl = { cmd = "scripts/poe-tasks/kresctl", help="Run kresctl utility" }
clean = """
rm -rf .coverage
.mypy_cache
diff --git a/scripts/poe-tasks/kresctl b/scripts/poe-tasks/kresctl
new file mode 100755
index 00000000..4b4880b7
--- /dev/null
+++ b/scripts/poe-tasks/kresctl
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# ensure consistent behaviour
+src_dir="$(dirname "$(realpath "$0")")"
+source $src_dir/_env.sh
+
+# run knot-resolver client
+python3 -m knot_resolver_manager.cli $@