From 0fc1a44bc8f93e8ebf33070ed83570be26b72ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20=E2=AD=90=E2=AD=90?= <6878027+jmau111@users.noreply.github.com> Date: Mon, 13 Feb 2023 16:43:22 +0100 Subject: [PATCH] don't limit the script to Debian-based distros remove automatic install apt --- gitconfig.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gitconfig.sh b/gitconfig.sh index f6d80c8..c2ffd74 100755 --- a/gitconfig.sh +++ b/gitconfig.sh @@ -22,9 +22,14 @@ OPTIONS: EOF } +function err() { + echo -e "\e[1;31m$1\033[0m" >&2 + echo +} + maybe_install_git() { if ! [ -x "$(command -v git)" ]; then - sudo apt install -y git + err "I need Git. Please install it on your system. For example 'sudo apt install -y git' on Debian" fi } @@ -44,11 +49,6 @@ function configure_git() { git config --global alias.grep '!git ls-files | grep -i' } -function err() { - echo -e "\e[1;31m$1\033[0m" >&2 - echo -} - main() { local BACKUP_FOLDER="$HOME/gitconfig-backups"