mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
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:
committed by
GitHub
parent
aa94d89f97
commit
29b2eaa217
@ -176,8 +176,8 @@ func (r *RootCmd) dotfiles() *clibase.Cmd {
|
|||||||
|
|
||||||
var dotfiles []string
|
var dotfiles []string
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
// make sure we do not copy `.git*` files
|
// make sure we do not copy `.git*` files except `.gitconfig`
|
||||||
if strings.HasPrefix(f.Name(), ".") && !strings.HasPrefix(f.Name(), ".git") {
|
if strings.HasPrefix(f.Name(), ".") && (!strings.HasPrefix(f.Name(), ".git") || f.Name() == ".gitconfig") {
|
||||||
dotfiles = append(dotfiles, f.Name())
|
dotfiles = append(dotfiles, f.Name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user