You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fisher/functions/__fisher_gist_to_name.fish

22 lines
469 B
Fish

9 years ago
function -S __fisher_gist_to_name -a url
set -l gist_id (printf "%s\n" "$url" | sed 's|.*/||')
set -l name (
9 years ago
spin "curl -Ss https://api.github.com/gists/$gist_id" -f " $color@$color_normal\r" | awk '
9 years ago
/"files": / { files++ }
9 years ago
/"[^ ]+.fish": / && files {
gsub("^ *\"|\.fish.*", "")
print
}
'
)
if test -z "$name"
return 1
end
printf "%s\n" $name
end