fix(cli/dotfiles): add an exception for .gitconfig (#9515)

* fix(cli/dotfiles): Only ignore .git directory 

Resolves #8306

* fix fmt

* add exception for .gitconfig

* Update dotfiles.go
This commit is contained in:
Muhammad Atif Ali
2023-09-04 16:17:07 +03:00
committed by GitHub
parent aa94d89f97
commit 29b2eaa217

View File

@ -176,8 +176,8 @@ func (r *RootCmd) dotfiles() *clibase.Cmd {
var dotfiles []string
for _, f := range files {
// make sure we do not copy `.git*` files
if strings.HasPrefix(f.Name(), ".") && !strings.HasPrefix(f.Name(), ".git") {
// make sure we do not copy `.git*` files except `.gitconfig`
if strings.HasPrefix(f.Name(), ".") && (!strings.HasPrefix(f.Name(), ".git") || f.Name() == ".gitconfig") {
dotfiles = append(dotfiles, f.Name())
}
}