Permalink
Browse files

Fallback to ~/.resty without XDG dirs

Be a bit kinder to people without XDG goodness
  • Loading branch information...
namelessjon committed Jul 15, 2011
1 parent 39ac1c9 commit 7a693be7294ebfbf92ea68bb362ea22e98fdaef7
Showing with 7 additions and 2 deletions.
  1. +7 −2 resty
View
9 resty
@@ -18,9 +18,14 @@ function resty() {
local -a curlopt
local -a curlopt2
- confdir="${XDG_CONFIG_HOME}/resty"
+ if [ -n "$XDG_CONFIG_HOME" ]; then
+ confdir="$XDG_CONFIG_HOME/resty"
+ datadir="$XDG_DATA_HOME/resty"
+ else
+ confdir="$HOME/.resty"
+ datadir="$confdir"
+ fi
mkdir -p "$confdir"
- datadir="${XDG_DATA_HOME}/resty"
host="$datadir/host"
cookies="$datadir/c"
method="$1"; [[ $# > 0 ]] && shift

0 comments on commit 7a693be

Please sign in to comment.