Skip to content

Commit

Permalink
fix(init): write to gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Voltaire authored and viktorvoltaire committed Jan 2, 2022
1 parent 1ef7286 commit fc3f8e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
# vendor/

.idea/
.mage/gen
*.tools/
.mage/gen/
.tools/
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ func initMageTools() {
if err := execCommandInDirectory(mageDir, "go", []string{"mod", "tidy"}...); err != nil {
panic(err)
}
gitIgnore, err := os.OpenFile(".gitignore", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
if err != nil {
panic(err)
}
defer gitIgnore.Close()
if _, err := gitIgnore.WriteString(".mage/gen/\n.tools/"); err != nil {
panic(err)
}
// TODO: Output some documentation, next steps after init, and useful links.
logger.Info("mage-tools initialized!")
}
Expand Down

0 comments on commit fc3f8e5

Please sign in to comment.