From: Aleš Mrázek Date: Tue, 27 Aug 2024 13:26:58 +0000 (+0200) Subject: scripts/poe-tasks: clean added X-Git-Tag: v6.0.9~18^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=664c31349063f5f782c41a3713c866fcc9c39715;p=thirdparty%2Fknot-resolver.git scripts/poe-tasks: clean added --- diff --git a/pyproject.toml b/pyproject.toml index da8485c43..fefe24aca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,17 +80,8 @@ examples = { cmd = "scripts/poe-tasks/examples", help = "Validate all configurat man = {cmd = "scripts/poe-tasks/man", help = "Display Knot Resolver manpage from sources" } gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.py' file for backwards compatibility" } 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 = { cmd = "scripts/poe-tasks/kresctl", help="Run kresctl utility" } -clean = """ - rm -rf .coverage - .mypy_cache - .pytest_cache - ./**/__pycache__ - build - dist -""" +clean = { cmd = "scripts/poe-tasks/clean", help="Cleanup build directories and files" } [tool.black] line-length = 120 diff --git a/scripts/poe-tasks/clean b/scripts/poe-tasks/clean new file mode 100755 index 000000000..ff69ad69e --- /dev/null +++ b/scripts/poe-tasks/clean @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# ensure consistent behaviour +src_dir="$(dirname "$(realpath "$0")")" +source $src_dir/utils/_env.sh + +echo +echo Removing mypy, pytest and other cached files +echo -------------------------------------------- +rm -vrf .coverage .mypy_cache .pytest_cache + +echo +echo Removing meson build directories and files +echo ------------------------------------------ +rm -vrf .build_kresd .install_kresd build build_doc dist + +echo +echo Removing __pycache__ directories and files +echo ------------------------------------------ +find . -type d -name '__pycache__' -prune -exec rm -vrf {} +