ignore dotctl config in git (#18)

pull/20/head
Marcus Kok 2 years ago committed by GitHub
parent 16051e8645
commit f41e35d956
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -81,6 +81,23 @@ func runInitCommand(cmd *cobra.Command, args []string) {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
gitignoreContent := []byte (`
# ignore dotctl config for individual installations
dotctl/
.DS_Store
*.swp
*.bak
*.tmp
`)
err := afero.WriteFile(fs, filepath.Join(DotfilePath, ".gitignore"), gitignoreContent, 0644)
if err != nil {
log.Fatal(err)
}
} }
fmt.Fprintf(cmd.OutOrStdout(), "Successfully created dotfiles repository at %s\n", DotfilePath) fmt.Fprintf(cmd.OutOrStdout(), "Successfully created dotfiles repository at %s\n", DotfilePath)

@ -53,6 +53,9 @@ func gitAddFiles(worktree *git.Worktree, fs afero.Fs) error {
return err return err
} }
for _, entry := range(entries) { for _, entry := range(entries) {
if(entry.Name() == "dotctl") {
continue
}
_, err = worktree.Add(entry.Name()) _, err = worktree.Add(entry.Name())
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save