aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/gist6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/gist b/scripts/gist
index 4e2d311..b2767b1 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -142,8 +142,7 @@ _apply_config() {
142_apply_config "$@" || exit 1 142_apply_config "$@" || exit 1
143 143
144## This function determines which http get tool the system has installed and returns an error if there isnt one 144## This function determines which http get tool the system has installed and returns an error if there isnt one
145getConfiguredClient() 145getConfiguredClient() {
146{
147 if command -v curl &>/dev/null; then 146 if command -v curl &>/dev/null; then
148 configuredClient="curl" 147 configuredClient="curl"
149 elif command -v wget &>/dev/null; then 148 elif command -v wget &>/dev/null; then
@@ -159,8 +158,7 @@ getConfiguredClient()
159} 158}
160 159
161## Allows to call the users configured client without if statements everywhere 160## Allows to call the users configured client without if statements everywhere
162httpGet() 161httpGet() {
163{
164 local header="" 162 local header=""
165 case "$configuredClient" in 163 case "$configuredClient" in
166 curl) [[ -n $token ]] && header="--header Authorization: token $token"; curl -A curl -s $header "$@" ;; 164 curl) [[ -n $token ]] && header="--header Authorization: token $token"; curl -A curl -s $header "$@" ;;