From 7f8f9ddc27d8bdea9ef49018df298ac21d86b82d Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sun, 9 Jan 2022 17:23:19 +0800 Subject: [PATCH] fix git.sh --- install/010-git.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install/010-git.sh b/install/010-git.sh index 1dee6dd..f9f2325 100755 --- a/install/010-git.sh +++ b/install/010-git.sh @@ -5,6 +5,10 @@ echo "Installing git..." echo "===============================================" echo +installed() { + command -v "$1" >/dev/null 2>&1 +} + if installed git; then [ ! -d "/usr/src/git" ] && sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git sudo chown -R $USER: /usr/src/git @@ -24,6 +28,5 @@ else sudo chown -R $USER: /usr/src/git fi ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -DOTFILESDIR="$ENVDIR"/dotfiles -git --version -cp $DOTFILESDIR/.gitconfig $HOME/.gitconfig \ No newline at end of file +cp "$ENVDIR"/dotfiles/.gitconfig $HOME/.gitconfig +git --version \ No newline at end of file