diff options
Diffstat (limited to 'scripts/gist')
| -rwxr-xr-x | scripts/gist | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/scripts/gist b/scripts/gist index fad035c..9d884d8 100755 --- a/scripts/gist +++ b/scripts/gist | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | 37 | ||
| 38 | # TODO test on bats, mac and remote machine | 38 | # TODO test on bats, mac and remote machine |
| 39 | # TODO completion | 39 | # TODO completion |
| 40 | # FIXME mac: tac=tail -r | ||
| 41 | 40 | ||
| 42 | # Shell configuration | 41 | # Shell configuration |
| 43 | set -o pipefail | 42 | set -o pipefail |
| @@ -136,10 +135,8 @@ getConfiguredClient() { | |||
| 136 | configuredClient="wget" | 135 | configuredClient="wget" |
| 137 | elif command -v http &>/dev/null; then | 136 | elif command -v http &>/dev/null; then |
| 138 | configuredClient="httpie" | 137 | configuredClient="httpie" |
| 139 | elif command -v fetch &>/dev/null; then | ||
| 140 | configuredClient="fetch" | ||
| 141 | else | 138 | else |
| 142 | echo "Error: This tool requires either curl, wget, httpie or fetch to be installed." >&2 | 139 | echo "Error: This tool requires either curl, wget, or httpie to be installed." >&2 |
| 143 | return 1 | 140 | return 1 |
| 144 | fi | 141 | fi |
| 145 | } | 142 | } |
| @@ -157,8 +154,6 @@ http_method() { | |||
| 157 | httpie) [[ -n $token ]] && header="Authorization:token $token" | 154 | httpie) [[ -n $token ]] && header="Authorization:token $token" |
| 158 | [[ $METHOD =~ (POST|PATCH) ]] && extra2="@$http_data" | 155 | [[ $METHOD =~ (POST|PATCH) ]] && extra2="@$http_data" |
| 159 | http -b $METHOD "$@" "$header" $extra2 ;; | 156 | http -b $METHOD "$@" "$header" $extra2 ;; |
| 160 | # TODO add other methods | ||
| 161 | fetch) fetch -q "$@" ;; | ||
| 162 | esac | 157 | esac |
| 163 | } | 158 | } |
| 164 | 159 | ||