mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-22 08:11:28 +00:00
Bug fix: alias broken auth when switch instance; replace alias to func
This commit is contained in:
parent
4a40baf76a
commit
82630e20c0
|
@ -20,9 +20,12 @@ echo "Instance: $instance"
|
|||
if [ -n "$auth" ]; then
|
||||
default_curl_opt()
|
||||
{
|
||||
curl -s --compressed -H "Authorization: Bearer $auth" $1
|
||||
curl -s --compressed -H "Authorization: Bearer $auth" "$@"
|
||||
}
|
||||
post_request()
|
||||
{
|
||||
curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@"
|
||||
}
|
||||
alias post_request="curl -s --compressed -X POST -H \"Authorization: Bearer $auth\""
|
||||
echo '+Authorized account+'
|
||||
else
|
||||
default_curl_opt()
|
||||
|
@ -557,9 +560,12 @@ case $main_menu in
|
|||
if [ -n "$auth" ]; then
|
||||
default_curl_opt()
|
||||
{
|
||||
curl -s --compressed -H "Authorization: Bearer $auth" $1
|
||||
curl -s --compressed -H "Authorization: Bearer $auth" "$@"
|
||||
}
|
||||
post_request()
|
||||
{
|
||||
curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@"
|
||||
}
|
||||
alias post_request="curl -s --compressed -X POST -H \"Authorization: Bearer $auth\""
|
||||
echo '+Authorized account+'
|
||||
else
|
||||
default_curl_opt()
|
||||
|
|
Loading…
Reference in a new issue