From eddef3c24b8fdc56e24d1e1c09b71506f18123d6 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 15 Jan 2023 07:26:54 +0000 Subject: [PATCH] ref: simplify download folder check --- _webi/template.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_webi/template.sh b/_webi/template.sh index a57eb7f..615b328 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -33,10 +33,15 @@ __bootstrap_webi() { WEBI_UA="$(uname -a)" WEBI_PKG_DOWNLOAD="" WEBI_DOWNLOAD_DIR="${HOME}/Downloads" - if [ -n "$(command -v xdg-user-dir)" ] && [ "$(xdg-user-dir DOWNLOAD)" != "$HOME" ]; then + if command -v xdg-user-dir > /dev/null; then WEBI_DOWNLOAD_DIR="$(xdg-user-dir DOWNLOAD)" + if [ "${WEBI_DOWNLOAD_DIR}" = "${HOME}" ]; then + WEBI_DOWNLOAD_DIR="${HOME}/Downloads" + fi fi + WEBI_PKG_PATH="${WEBI_DOWNLOAD_DIR}/webi/${PKG_NAME:-error}/${WEBI_VERSION:-latest}" + export WEBI_HOST ##