1
0
Fork 0
mirror of https://github.com/kou029w/dotfiles.git synced 2025-01-18 08:05:01 +00:00

use include gitconfig

This commit is contained in:
Nebel 2022-10-26 23:52:56 +09:00
parent e0d6d7f65a
commit 88ea239f58
3 changed files with 10 additions and 0 deletions

View file

@ -5,5 +5,6 @@ cd -- "$(dirname -- "$0")"
(($(id -u) == 0)) \
&& [[ -f /etc/debian_version ]] \
&& install_apt_packages
install_gitconfig
install_dotfiles
install_addons "$@"

View file

@ -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