From 37ab61dc3f83cf3da1a4befb2c2385da0235c749 Mon Sep 17 00:00:00 2001 From: Martin Matyasek Date: Fri, 8 Apr 2022 20:41:40 +0200 Subject: [PATCH] Move wget-hsts to XDG_CACHE_HOME Addresses https://github.com/matyama/configs/issues/17 - Adds an alias for `wget` that adds `--hsts-file` option pointing to file in `XDG_CACHE_HOME` - The alias is added to `.zshenv` even though it's not a good practice to modify command behavior in it - The rationale is that we want to prevent all executions from creating the file in `$HOME`, other that that it still behaves as regular wget After setting this alias it's safe to just move/rename existing `~/.wget-hsts` file to `$XDG_CACHE_HOME/wget-hsts`. --- .zshenv | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.zshenv b/.zshenv index 89dbbbe..3f15618 100644 --- a/.zshenv +++ b/.zshenv @@ -76,6 +76,17 @@ export FD_CONFIG_HOME=${XDG_CONFIG_HOME}/fd export RIPGREP_CONFIG_HOME="${XDG_CONFIG_HOME}/rg" export RIPGREP_CONFIG_PATH=${RIPGREP_CONFIG_HOME}/ripgreprc +# wget +# - Despite the fact it's not recommended to override command behavior in +# `.envrc` (since it's always loaded, even for non-interactive shells), here +# we actually want to prevent all executions from creating `~/.wget-hsts` +# - An alternative is to set `hsts-file` in `WGETRC` but it must use an absolute +# path, i.e. cannot dynamically change with `XDG_CACHE_HOME` +# - See: https://wiki.archlinux.org/title/XDG_Base_Directory +# - Uncomment `WGETRC` if it's present and should be used +#export WGETRC=${XDG_CONFIG_HOME}/wgetrc +alias wget="wget --hsts-file=${XDG_CACHE_HOME}/wget-hsts" + # Dungeon Crawl Stone Soup # - Note: the trailing slash is required # - See: https://wiki.archlinux.org/title/XDG_Base_Directory