Skip to content

Commit 109e4ed

Browse files
dmcardlencw
authored andcommitted
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 rclone#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.
1 parent 3532702 commit 109e4ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,14 @@ MANUAL.txt: MANUAL.md
144144
pandoc -s --from markdown-smart --to plain MANUAL.md -o MANUAL.txt
145145

146146
commanddocs: rclone
147+
-@rmdir -p '$$HOME/.config/rclone'
147148
XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" rclone gendocs --config=/notfound docs/content/
149+
@[ ! -e '$$HOME' ] || (echo 'Error: created unwanted directory named $$HOME' && exit 1)
148150

149151
backenddocs: rclone bin/make_backend_docs.py
152+
-@rmdir -p '$$HOME/.config/rclone'
150153
XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" ./bin/make_backend_docs.py
154+
@[ ! -e '$$HOME' ] || (echo 'Error: created unwanted directory named $$HOME' && exit 1)
151155

152156
rcdocs: rclone
153157
bin/make_rc_docs.sh

0 commit comments

Comments
 (0)