summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-02-01 11:39:36 +0800
committertypebrook <typebrook@gmail.com>2020-02-01 11:39:36 +0800
commit0bc60cc2cc2225b6b17ebc07fb814d5fd3e5aef1 (patch)
treec591ebcb68d424819e2d61d43f0a59c7b2596674
parent736c7e4639c0fc795a60db1b087b8434924eb63f (diff)
update
-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 "$@" ;;