fix git installation

This commit is contained in:
Reinaldy Rafli 2021-08-16 14:03:25 +07:00
parent f0fde89fb9
commit 6adc138502
2 changed files with 47 additions and 17 deletions

26
scripts/git.sh Normal file → Executable file
View File

@ -1,5 +1,20 @@
#!/usr/bin/env bash
VERSION="2.32.0"
function install () {
cd ~
wget https://github.com/git/git/archive/refs/tags/v${VERSION}.zip
sudo unzip v${VERSION}.zip
cd git-${VERSION}
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
cd ~
sudo rm -rf git-${VERSION}
sudo rm v${VERSION}.zip
}
function setup () {
echo "create a ssh key"
echo "gimme your email: "
read EMAIL
@ -16,3 +31,14 @@ git config --global user.signingkey $SECRETKEY
echo "now go to the .ssh directory, copy the contents of the id_rsa.pub to github"
echo "then copy the public key block above also to github"
echo "link to speed up everything: https://github.com/settings/keys"
}
if [ "$1" == "install" ]; then
install
elif [ "$1" == "setup" ]; then
setup
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
fi

View File

@ -26,23 +26,27 @@ function set_symlink () {
sudo ln -s ${DOTFILES_PATH}/git/.czrc $HOME/.czrc
}
sudo chmod -R 755 ./scripts
sudo chmod -R 755 ./bin
if [[ $(cat /etc/issue) = *"Ubuntu"* ]]; then
sudo apt update
sudo apt upgrade
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install -y curl wget openssl tar unzip git rlwrap editorconfig gpg build-essential libffi-dev libgdbm-dev libsqlite3-dev libssl-dev zlib1g-dev
set_symlink
elif [[ $(cat /etc/issue) = *"Debian"* ]]; then
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y curl wget openssl tar unzip git rlwrap editorconfig gpg build-essential libffi-dev libgdbm-dev libsqlite3-dev libssl-dev zlib1g-dev
sudo apt-get install -y libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext
./scripts/git.sh install
set_symlink
else
echo "you will need to install curl, wget, openssl, gpg, and other stuff yourself"
fi
sudo chmod -R 755 ./scripts
sudo chmod -R 755 ./bin
./scripts/python.sh install
./scripts/node.sh install