From 1a5f2608dbdfe82548d5d1f2c91d1d81e01cbc80 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Fri, 6 May 2016 00:46:14 +0900 Subject: [PATCH] Check if git, curl, etc., are installed before using them and inform the user. Close #253. --- fisher.fish | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/fisher.fish b/fisher.fish index a04ffa0..2c60869 100644 --- a/fisher.fish +++ b/fisher.fish @@ -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 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