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_path_from_url.fish

19 lines
551 B
Fish

function __fisher_path_from_url -a url
# What is the difference between path-from-url and url-from-path?
# Both functions use 'git ... --get-url'. The first one compares the given URL with
# the ls-remote of each repo in the cache and returns the path of the first match.
# The other one returns the ls-remote of the given path.
for file in $fisher_cache/*
switch "$url"
case (git -C $file ls-remote --get-url)
printf "%s\n" $file
return
end
end
return 1
end