From 109e4ed0ed816415f283314566b4815df4b443ae Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Mon, 23 Sep 2024 17:39:36 -0400 Subject: [PATCH] Makefile: Fail when doc recipes create dir named '$HOME' This commit makes the `commanddocs` and `backenddocs` fail if they accidentally create a directory named '$HOME'. This is basically a regression test for issue #8092. It also makes those recipes rmdir the '$HOME/.config/rclone/' directories. This will only delete empty directories, so nothing of value should ever be deleted. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 9635cdf13..2e55c5a0c 100644 --- a/Makefile +++ b/Makefile @@ -144,10 +144,14 @@ MANUAL.txt: MANUAL.md pandoc -s --from markdown-smart --to plain MANUAL.md -o MANUAL.txt commanddocs: rclone + -@rmdir -p '$$HOME/.config/rclone' XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" rclone gendocs --config=/notfound docs/content/ + @[ ! -e '$$HOME' ] || (echo 'Error: created unwanted directory named $$HOME' && exit 1) backenddocs: rclone bin/make_backend_docs.py + -@rmdir -p '$$HOME/.config/rclone' XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" ./bin/make_backend_docs.py + @[ ! -e '$$HOME' ] || (echo 'Error: created unwanted directory named $$HOME' && exit 1) rcdocs: rclone bin/make_rc_docs.sh