From 21eefa012f38be487393ae602a41bcd64b018d34 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 22 Oct 2013 23:12:45 -0200 Subject: Check git-annex and keyringer installation --- share/hydra/sync | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/hydra/sync b/share/hydra/sync index 6fd8d19..873694e 100755 --- a/share/hydra/sync +++ b/share/hydra/sync @@ -26,6 +26,11 @@ else UPDATE_KEYRINGER="no" fi +# Check for requirements. +for req in git-annex; do + hydra_install_package $req +done + # Sync each repository. # TODO: split between public and private repositories for repository in $REPOSITORIES; do @@ -37,8 +42,9 @@ for repository in $REPOSITORIES; do if [ ! -d "$HYDRA_FOLDER/$repository/.git" ]; then git clone $PRIVATE_REPOS/$repository $HYDRA_FOLDER/$repository - # TODO: check if keyringer is installed - if [ ! -e "$HOME/.keyringer/$HYDRA" ]; then + if ! which keyringer &> /dev/null; then + echo "Please install keyringer for a full hydra experience." + elif [ ! -e "$HOME/.keyringer/$HYDRA" ]; then echo "Initializing keyring for $HYDRA..." keyringer $HYDRA init $HYDRA_FOLDER/$repository fi @@ -47,7 +53,6 @@ for repository in $REPOSITORIES; do if [ -d "$HYDRA_FOLDER/$repository/.git" ]; then echo "Syncing $repository..." - # TODO: check if git-annex is installed if [ "$repository" == "bootless" ]; then ( cd $HYDRA_FOLDER/$repository && git annex sync ) else -- cgit v1.2.3