Permalink
Browse files

Don't try to load configs if they don't exist

This prevents a 'grep *' from happening in the current working directory.
  • Loading branch information...
1 parent 58560a1 commit 23db39aa70af26a28518e85a31e89fb22fe37caa @pcl pcl committed May 1, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 resty
View
2 resty
@@ -81,7 +81,7 @@ function resty() {
[ "$1" = "-Z" ] && raw="yes" && [[ $# > 0 ]] && shift
[ -n "$dat" ] && opt="--data-binary"
[ "$method" = "HEAD" ] && opt="-I" && raw="yes"
- eval "args2=( $(cat "$confdir/$domain" 2>/dev/null |sed 's/^ *//' |grep ^$method |cut -b $((${#method}+2))-) )"
+ [ -f "$confdir/$domain" ] && eval "args2=( $(cat "$confdir/$domain" 2>/dev/null |sed 's/^ *//' |grep ^$method |cut -b $((${#method}+2))-) )"
res=$((((curl -sLv $opt "$dat" -X $method \
-b "$cookies/$domain" -c "$cookies/$domain" \
"${args2[@]}" "${curlopt2[@]}" "${curlopt[@]}" "$_path$query" \

0 comments on commit 23db39a

Please sign in to comment.