Create gitignore when using g option (#1430)

* Create gitignore when using g option
This commit is contained in:
Jae-Sung Lee
2022-05-31 20:29:20 +10:00
committed by GitHub
parent 2a0673f99f
commit f292e221f1
@@ -216,6 +216,16 @@ func initGit(options *templates.Options) error {
return errors.Wrap(err, "Unable to initialise git repository:")
}
ignore := []string{
"build/bin",
"frontend/dist",
"frontend/node_modules",
}
err = os.WriteFile(filepath.Join(options.TargetDir, ".gitignore"), []byte(strings.Join(ignore, "\n")), 0644)
if err != nil {
return errors.Wrap(err, "Unable to create gitignore")
}
return nil
}