Skip to content

Commit a4c1f74

Browse files
committed
Generate .gitignore
1 parent c6777c0 commit a4c1f74

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

new_client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ var clientTSGameTemplate string
3535
//go:embed templates/new/client/index.html.tmpl
3636
var clientIndexHTMLTemplate string
3737

38+
//go:embed templates/new/gitignore.tmpl
39+
var gitignoreTemplate string
40+
3841
func CreateNewClient(projectName string) error {
3942
data, err := modules.ReadCommandConfig[modules.NewClientData]()
4043
if err != nil {
@@ -250,6 +253,11 @@ func execClientTemplate(projectName string, info server.GameInfo, eventNames, co
250253
if err != nil {
251254
return err
252255
}
256+
257+
err = ExecTemplate(gitignoreTemplate, ".gitignore", data)
258+
if err != nil {
259+
return err
260+
}
253261
}
254262

255263
return nil

templates/new/gitignore.tmpl

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Build output
2+
dist/
3+
build/
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
.pnpm-debug.log*
13+
14+
# Diagnostic reports
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Dependency directories
24+
node_modules/
25+
{{ if .TypeScript }}
26+
# TypeScript cache
27+
*.tsbuildinfo
28+
{{ end }}
29+
# Optional npm cache directory
30+
.npm
31+
32+
# Optional eslint cache
33+
.eslintcache
34+
35+
# Optional stylelint cache
36+
.stylelintcache
37+
38+
# Optional REPL history
39+
.node_repl_history
40+
41+
# Output of 'npm pack'
42+
*.tgz
43+
44+
# Yarn Integrity file
45+
.yarn-integrity
46+
47+
# dotenv environment variable files
48+
.env
49+
.env.development.local
50+
.env.test.local
51+
.env.production.local
52+
.env.local
53+
{{ if .Bundler }}
54+
# parcel-bundler cache
55+
.cache
56+
.parcel-cache
57+
{{ end }}
58+
# yarn v2
59+
.yarn/cache
60+
.yarn/unplugged
61+
.yarn/build-state.yml
62+
.yarn/install-state.gz
63+
.pnp.*

0 commit comments

Comments
 (0)