1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 10:51:41 +00:00

Rename git-hub-short-url to git-hub-shorten-url

This commit is contained in:
Sorin Ionescu
2012-09-24 18:19:41 -04:00
parent 7dd78595ae
commit 9785454938
2 changed files with 2 additions and 2 deletions

View File

@ -0,0 +1,23 @@
#
# Shortens GitHub URLs.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
local url="$1"
if [[ "$url" == '-' ]]; then
read url <&0
fi
if [[ -z "$url" ]]; then
print "usage: $0 [ url | - ]" >&2
fi
if (( $+commands[curl] )); then
curl -s -i 'http://git.io' -F "url=$url" | grep 'Location:' | sed 's/Location: //'
else
print "$0: command not found: curl" >&2
fi