From 2fae9e358a1cf8c0687a8143c116a6739541d714 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 26 Oct 2022 23:52:56 +0900 Subject: [PATCH] use include gitconfig --- .gitconfig => gitconfig | 0 install | 1 + mod.bash | 9 +++++++++ 3 files changed, 10 insertions(+) rename .gitconfig => gitconfig (100%) diff --git a/.gitconfig b/gitconfig similarity index 100% rename from .gitconfig rename to gitconfig diff --git a/install b/install index a392588..43d745b 100755 --- a/install +++ b/install @@ -6,5 +6,6 @@ if (($(id -u) == 0)); then [[ -f /etc/debian_version ]] \ && install_apt_packages fi +install_gitconfig install_dotfiles install_addons "$@" diff --git a/mod.bash b/mod.bash index 10babd6..76ba3c5 100644 --- a/mod.bash +++ b/mod.bash @@ -13,6 +13,15 @@ function install_dotfiles() { done } +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_apt_packages() { local packages local apt_sources_dir