Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 38c3a87dd2 |
@@ -10,3 +10,19 @@ Usage examples:
|
||||
scaffold go NewGoProject
|
||||
scaffold py aPythonProject
|
||||
`
|
||||
|
||||
var gi_template = `%s
|
||||
.env
|
||||
*.env
|
||||
.env.toml
|
||||
|
||||
cfg/*.toml
|
||||
cfg/.env
|
||||
cfg/*.env
|
||||
cfg/.env*
|
||||
*.toml
|
||||
|
||||
build/
|
||||
buildTime.txt
|
||||
buildVersion.txt
|
||||
`
|
||||
|
||||
8
main.go
8
main.go
@@ -176,6 +176,14 @@ func main() {
|
||||
_, err = exec.Command("git", "init").Output()
|
||||
ifFerr("Unable to initialize git repository", err)
|
||||
|
||||
nifd, err := os.Create(".gitignore")
|
||||
ifFerr("Unable to create .gitignore file", err)
|
||||
defer nifd.Close()
|
||||
gi_content := fmt.Sprintf(gi_template, newProjectName)
|
||||
_, err = nifd.WriteString(gi_content)
|
||||
ifFerr("Unable to write .gitignore content", err)
|
||||
fmt.Println("Wrote .gitignore content")
|
||||
|
||||
// stage files
|
||||
_, err = exec.Command("git", "add", ".").Output()
|
||||
ifFerr("Unable to stage files prior to first commit", err)
|
||||
|
||||
Reference in New Issue
Block a user