From 4723810e2b3dfa95931f9a10c9ada95cec28061e Mon Sep 17 00:00:00 2001 From: Vladimir Siritsa Date: Fri, 6 Jan 2023 13:21:52 +0200 Subject: [PATCH] feat: set Downloads dir from xdg-user-dir DOWNLOAD when available --- _webi/template.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_webi/template.sh b/_webi/template.sh index d5fb017..a57eb7f 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -32,7 +32,11 @@ __bootstrap_webi() { #PKG_FORMATS= WEBI_UA="$(uname -a)" WEBI_PKG_DOWNLOAD="" - WEBI_PKG_PATH="${HOME}/Downloads/webi/${PKG_NAME:-error}/${WEBI_VERSION:-latest}" + WEBI_DOWNLOAD_DIR="${HOME}/Downloads" + if [ -n "$(command -v xdg-user-dir)" ] && [ "$(xdg-user-dir DOWNLOAD)" != "$HOME" ]; then + WEBI_DOWNLOAD_DIR="$(xdg-user-dir DOWNLOAD)" + fi + WEBI_PKG_PATH="${WEBI_DOWNLOAD_DIR}/webi/${PKG_NAME:-error}/${WEBI_VERSION:-latest}" export WEBI_HOST ##