Skip to content

Commit

Permalink
fix(commands/new): fix repository path usage
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosstrand committed Aug 22, 2021
1 parent 7764a91 commit 7f7ae7d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Binary file modified cmd/zepto/_templates/web/public/images/gopher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions cmd/zepto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ var templates embed.FS

var rootCmd = &cobra.Command{
Use: "zepto",
Short: "Zepto is a lightweight web framework",
Long: "Zepto is a lightweight web framework written in golang.\nComplete documentation is available at https://go-zepto.github.io/zepto",
Short: "Zepto is a lightweight golang web framework",
Long: "Zepto is a lightweight golang web framework.\nComplete documentation is available at https://go-zepto.com/docs",
}

func Execute() {
Expand Down
7 changes: 4 additions & 3 deletions commands/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ func ExecuteWeb(templates embed.FS, args []string) {
s := spinner.New(spinner.CharSets[9], 100*time.Millisecond)
fmt.Println("Creating web project...")
s.Start()
projectName := args[0]
projectDir := "./" + projectName
projectRepoPath := args[0]
folderName := filepath.Base(projectRepoPath)
projectDir := "./" + folderName

err := utils.CopyDirFromEmbed(templates, "_templates/web", projectDir)
if err != nil {
Expand All @@ -57,7 +58,7 @@ func ExecuteWeb(templates embed.FS, args []string) {
panic(err)
}
replaceFunc := func(c string) string {
return strings.Replace(c, DEFAULT_TMPL_MODULE_PATH, projectName, -1)
return strings.Replace(c, DEFAULT_TMPL_MODULE_PATH, projectRepoPath, -1)
}
err = filepath.Walk(projectDir, ReplaceWalk(projectDir, replaceFunc))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package zeptocli

var VERSION = "1.0.12"
var VERSION = "1.0.13"

0 comments on commit 7f7ae7d

Please sign in to comment.