@@ -45,6 +45,12 @@ import (
4545 "github.com/spf13/afero"
4646)
4747
48+ // copyIgnoreDirectories are directories to skip when copying a template.
49+ var copyIgnoreDirectories = []string {".git" , ".venv" , "node_modules" }
50+
51+ // copyIgnoreFiles are files to skip when copying a template.
52+ var copyIgnoreFiles = []string {".DS_Store" }
53+
4854// CreateArgs are the arguments passed into the Create function
4955type CreateArgs struct {
5056 AppName string
@@ -337,8 +343,8 @@ func createApp(ctx context.Context, dirPath string, template Template, gitBranch
337343 copyDirectoryOpts := goutils.CopyDirectoryOpts {
338344 Src : template .path ,
339345 Dst : dirPath ,
340- IgnoreDirectories : [] string { ".git" , ".venv" , "node_modules" } ,
341- IgnoreFiles : [] string { ".DS_Store" } ,
346+ IgnoreDirectories : copyIgnoreDirectories ,
347+ IgnoreFiles : copyIgnoreFiles ,
342348 }
343349 if err := goutils .CopyDirectory (copyDirectoryOpts ); err != nil {
344350 return slackerror .Wrap (err , "error copying local template" )
@@ -403,8 +409,8 @@ func createAppFromSubdir(ctx context.Context, dirPath string, template Template,
403409 return goutils .CopyDirectory (goutils.CopyDirectoryOpts {
404410 Src : subdirPath ,
405411 Dst : dirPath ,
406- IgnoreDirectories : [] string { ".git" , ".venv" , "node_modules" } ,
407- IgnoreFiles : [] string { ".DS_Store" } ,
412+ IgnoreDirectories : copyIgnoreDirectories ,
413+ IgnoreFiles : copyIgnoreFiles ,
408414 })
409415}
410416
0 commit comments