1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-01 09:19:25 +00:00

git: Optimize scripts for git helper functions

Optimize git internal calls and adjustment git helper functions to use
more idiomatic Zsh conventions avoiding external calls.
This commit is contained in:
Indrajit Raychaudhuri
2021-05-19 19:54:57 -05:00
committed by Indrajit Raychaudhuri
parent efebe3efec
commit a3643f124e
6 changed files with 14 additions and 14 deletions

View File

@ -19,7 +19,7 @@ if [[ -z "$url" || ! "$url" =~ ^https?:\/\/.*github.com\/ ]]; then
fi
if (( $+commands[curl] )); then
curl -s -i 'https://git.io' -F "url=$url" ${(s: :)code:+ -F "code=$code"} | sed -n 's/^Location: //p'
print "${${(@M)${(f)"$(curl -s -i 'https://git.io' -F "url=$url" ${(z)code:+ -F "code=$code"})"}:#Location: *}#Location: }"
else
print "$0: command not found: curl" >&2
return 1