Check if git, curl, etc., are installed before using them and inform the user. Close #253.

This commit is contained in:
Jorge Bucaran 2016-05-06 00:46:14 +09:00
parent 4ac3e19193
commit 1a5f2608db
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30

View file

@ -177,6 +177,36 @@ function fisher
end
end
switch "$cmd"
case install update
if not command -s git > /dev/null
__fisher_log error "
git is required to download plugin repositories.
" > /dev/stderr
__fisher_log info "
Please install git and try again.
Visit <https://git-scm.com> for more information.
" $__fisher_stderr
return 1
end
case ls ls-remote
if not command -s curl > /dev/null
__fisher_log error "
curl is required to query the GitHub API.
" > /dev/stderr
__fisher_log info "
Please install curl and try again.
Refer to your package manager documentation for instructions.
" $__fisher_stderr
return 1
end
end
switch "$cmd"
case install
if __fisher_install $items