Skip to content

Commit

Permalink
check whether git is available
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-luna-valero committed Dec 1, 2017
1 parent af966a1 commit 2880191
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions install-CGAT-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,19 @@ fi
}


# test whether --git and --git-ssh download is doable
test_git() {
git --version >& /dev/null || GIT_AVAIL=$?
if [[ $GIT_AVAIL -ne 0 ]] ; then
echo
echo " Git is not available but --git or --git-ssh option was given."
echo " Please rerun this script on a computer with git installed "
echo " or try again without --git or --git-ssh"
report_error " "
fi
}


# test whether --git-ssh download is doable
test_git_ssh() {
ssh-add -L >& /dev/null || SSH_KEYS_LOADED=$?
Expand Down Expand Up @@ -647,11 +660,13 @@ case $key in
--git)
CODE_DOWNLOAD_TYPE=1
shift
test_git
;;

--git-ssh)
CODE_DOWNLOAD_TYPE=2
shift
test_git
test_git_ssh
;;

Expand Down

0 comments on commit 2880191

Please sign in to comment.