prefer XDG over hard coded paths, resolves #17

This commit is contained in:
Bryan Jenks 2020-05-04 13:07:23 -07:00
parent 2f6e8b6c11
commit e30be22339
1 changed files with 2 additions and 1 deletions

3
flash
View File

@ -45,9 +45,10 @@
# Remember User's Starting Directory # Remember User's Starting Directory
PWD="$(pwd)" PWD="$(pwd)"
# Where Decks Are Located for linux & mac # Where Decks Are Located for linux & mac
# Prefer XDG Configuration before hard coded file paths
OS="$(uname)" OS="$(uname)"
case "$OS" in 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" ;; "Linux") DIR="${XDG_DATA_HOME:-$HOME/.local/share}/flash" ;;
*) DIR="${XDG_DATA_HOME:-$HOME/.local/share}/flash" ;; *) DIR="${XDG_DATA_HOME:-$HOME/.local/share}/flash" ;;
esac esac