Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Pull request -- avoid 'grep *' in cwd when no config files exist. #40

Merged
merged 1 commit into from

4 participants

Patrick Linskey Adam Lindberg Rudi Grinberg Micha Niskin
Patrick Linskey
pcl commented

This prevents a 'grep *' from happening in the current working directory.

Patrick Linskey pcl Don't try to load configs if they don't exist
This prevents a 'grep *' from happening in the current working directory.
23db39a
Adam Lindberg

Would appreciate this being merged. Currently the output is:

$ GET /json
grep: app: Is a directory
grep: config: Is a directory
grep: coverage: Is a directory
grep: db: Is a directory
grep: deploy: Is a directory
grep: doc: Is a directory
grep: lib: Is a directory
grep: log: Is a directory
grep: public: Is a directory
grep: script: Is a directory
grep: servlet: Is a directory
grep: test: Is a directory
grep: tmp: Is a directory
grep: vendor: Is a directory
grep: xml: Is a directory
{}
$

Which in my opinion makes the tool unusable.

Micha Niskin micha merged commit 68e5d05 into from
Micha Niskin
Owner

Thanks for the patch! Sorry it took so ridiculously long. I'm back now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 1, 2013
  1. Patrick Linskey

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

    pcl authored
    This prevents a 'grep *' from happening in the current working directory.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  resty
2  resty
View
@@ -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" \
Something went wrong with that request. Please try again.