diff --git a/.gitconfig b/gitconfig similarity index 100% rename from .gitconfig rename to gitconfig diff --git a/install b/install index b738198..0183845 100755 --- a/install +++ b/install @@ -5,5 +5,6 @@ cd -- "$(dirname -- "$0")" (($(id -u) == 0)) \ && [[ -f /etc/debian_version ]] \ && install_apt_packages +install_gitconfig install_dotfiles install_addons "$@" diff --git a/mod.bash b/mod.bash index 618b9b5..44c17cc 100644 --- a/mod.bash +++ b/mod.bash @@ -11,6 +11,15 @@ function install_apt_packages() { apt install -y "${packages[@]}" } +function install_gitconfig() { + if (($(id -u) == 0)); then + sudo --user="#${SUDO_UID:-0}" \ + git config --global --add include.path "$(realpath gitconfig)" + else + git config --global --add include.path "$(realpath gitconfig)" + fi +} + function install_dotfiles() { local home local dotfile