Skip to content

Commit

Permalink
chore: handle hidden files
Browse files Browse the repository at this point in the history
  • Loading branch information
mukezhz committed Nov 30, 2023
1 parent 3882ea3 commit 9dc2dc0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ func createProject(cmd *cobra.Command, args []string) {
// Create the same structure in the target directory
relPath, _ := filepath.Rel("templates/wesionary/project", path)
targetPath := filepath.Join(targetRoot, filepath.Dir(relPath))
dst := filepath.Join(targetPath, filepath.Base(path))
fileName := filepath.Base(path)
dst := filepath.Join(targetPath, fileName)
os.MkdirAll(targetPath, os.ModePerm)

// Handle template files
Expand All @@ -191,6 +192,9 @@ func createProject(cmd *cobra.Command, args []string) {
dst = strings.Replace(dst, ".mod", "", 1)
generateFromEmbeddedTemplate(path, dst, data)
} else {
if strings.HasPrefix(fileName, "hidden.") {
dst = strings.Replace(dst, "hidden.", ".", 1)
}
// just copy the files to the target directory
if err := copyFile(path, dst); err != nil {
panic(err)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9dc2dc0

Please sign in to comment.