diff --git a/gitconfig.d/.gitignore b/gitconfig.d/.gitignore index 913c1f5..15d3f08 100644 --- a/gitconfig.d/.gitignore +++ b/gitconfig.d/.gitignore @@ -1,5 +1,5 @@ -/* -!.gitignore -!example.gitconfig -!base.gitconfig +/* +!.gitignore +!example.gitconfig +!base.gitconfig !var \ No newline at end of file diff --git a/gitconfig.d/var/example.gitconfig b/gitconfig.d/var/example.gitconfig index 9ba26a3..86a14ba 100644 --- a/gitconfig.d/var/example.gitconfig +++ b/gitconfig.d/var/example.gitconfig @@ -1,14 +1,14 @@ -[user] - email = user@mail - name = John Doe - signingkey = 1234 -[credential] - helper = store -[push] - autoSetupRemote = true -[core] - autocrlf = true -[pull] - rebase = true -[commit] - gpgsign = true +[user] + email = user@mail + name = John Doe + signingkey = 1234 +[credential] + helper = store +[push] + autoSetupRemote = true +[core] + autocrlf = true +[pull] + rebase = true +[commit] + gpgsign = true diff --git a/scripts/install b/scripts/install index e8e4b33..7085f08 100755 --- a/scripts/install +++ b/scripts/install @@ -40,8 +40,14 @@ if [ -f "$HOME/.zshrc" ] && [ ! -L "$HOME/.zshrc" ]; then fi mkdir -p "$HOME/.ssh" -echo "Include $HOME/.config/ssh/*" >> "$HOME/.ssh/config" +if ! grep -Fxq "Include ~/.config/ssh/*" "$HOME/.ssh/config" 2>/dev/null; then + echo "Include ~/.config/ssh/*" >> "$HOME/.ssh/config" +fi - ln -s $DOTFILES_INSTALL_DIR/scripts/post-merge .git/hooks/post-merge +if [ -f "$DOTFILES_INSTALL_DIR/.git/hooks/post-merge" ]; then + rm "$DOTFILES_INSTALL_DIR/.git/hooks/post-merge" +fi -./setup +ln -s $DOTFILES_INSTALL_DIR/scripts/post-merge .git/hooks/post-merge + +./scripts/setup diff --git a/scripts/post-merge b/scripts/post-merge index cf802e2..071cb35 100755 --- a/scripts/post-merge +++ b/scripts/post-merge @@ -1,3 +1,3 @@ #!/usr/bin/env bash -./setup +./scripts/setup diff --git a/scripts/setup b/scripts/setup index c5c8fbc..e02457a 100755 --- a/scripts/setup +++ b/scripts/setup @@ -10,15 +10,6 @@ git submodule update --init --recursive find . -type d -name '.git*' -prune -o -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1 -echo "[+] Creating Gitconfigs..." - -( - for config in $PWD/.gitconfig.d/*.gitconfig; do - echo "[include]" - echo " path = $config" - done; -) > "$HOME/.gitconfig" - ./scripts/gitconfig echo