fix git.sh

experimental
Anthony Axenov 2022-01-09 17:23:19 +08:00
parent 7102cb38dc
commit 7f8f9ddc27
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
1 changed files with 6 additions and 3 deletions

View File

@ -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
cp "$ENVDIR"/dotfiles/.gitconfig $HOME/.gitconfig
git --version