From 6adc1385026324c9d24cc1158278d8c4e2a5e8bb Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Mon, 16 Aug 2021 14:03:25 +0700 Subject: [PATCH] fix git installation --- scripts/git.sh | 54 +++++++++++++++++++++++++++++++++++++------------- setup.sh | 10 +++++++--- 2 files changed, 47 insertions(+), 17 deletions(-) mode change 100644 => 100755 scripts/git.sh diff --git a/scripts/git.sh b/scripts/git.sh old mode 100644 new mode 100755 index f9a9f36..214bf43 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -1,18 +1,44 @@ #!/usr/bin/env bash -echo "create a ssh key" -echo "gimme your email: " -read EMAIL -ssh-keygen -t rsa -C $EMAIL +VERSION="2.32.0" -echo "create a gpg key" -gpg --full-generate-key -gpg --list-secret-keys --keyid-format=long -echo "enter the secret on sec rsa4096/THIS PART: " -read SECRETKEY -gpg --armor --export $SECRETKEY -git config --global user.signingkey $SECRETKEY +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 +} -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" \ No newline at end of file +function setup () { + echo "create a ssh key" + echo "gimme your email: " + read EMAIL + ssh-keygen -t rsa -C $EMAIL + + echo "create a gpg key" + gpg --full-generate-key + gpg --list-secret-keys --keyid-format=long + echo "enter the secret on sec rsa4096/THIS PART: " + read SECRETKEY + gpg --armor --export $SECRETKEY + 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 \ No newline at end of file diff --git a/setup.sh b/setup.sh index 16cb445..60e7a42 100755 --- a/setup.sh +++ b/setup.sh @@ -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