From e30be223390ee062301303967737a0dad80cb28f Mon Sep 17 00:00:00 2001 From: Bryan Jenks Date: Mon, 4 May 2020 13:07:23 -0700 Subject: [PATCH] prefer XDG over hard coded paths, resolves #17 --- flash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flash b/flash index 27d7be8..5c63138 100755 --- a/flash +++ b/flash @@ -45,9 +45,10 @@ # Remember User's Starting Directory PWD="$(pwd)" # Where Decks Are Located for linux & mac +# Prefer XDG Configuration before hard coded file paths OS="$(uname)" case "$OS" in - "Darwin") DIR="$HOME/Library/Application Support/flash" ;; + "Darwin") DIR="${XDG_DATA_HOME:-HOME/Library/Application Support}/flash" ;; "Linux") DIR="${XDG_DATA_HOME:-$HOME/.local/share}/flash" ;; *) DIR="${XDG_DATA_HOME:-$HOME/.local/share}/flash" ;; esac