Skip to content

Commit

Permalink
feat(cmd/gf): project templates update for command gf init (#3704)
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn authored Jul 24, 2024
1 parent ba322ba commit 4fdafa4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion cmd/gf/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DEFAULT_GOAL := pack

pack: pack.template-single pack.template-mono pack.template-mono-app

Expand All @@ -17,6 +18,9 @@ pack.template-mono:
@cd temp && gf pack template-mono ../internal/packed/template-mono.go -n=packed -y
@rm -fr temp

# Note:
# command `sed` only works on MacOS.
# use `grep -irl 'template-single' temp| xargs sed -i'' -e 's/template-single/template-mono-app/g'` on other platforms.
pack.template-mono-app:
@rm -fr temp
@mkdir temp || exit 0
Expand All @@ -27,6 +31,6 @@ pack.template-mono-app:
@rm -fr temp/template-mono-app/.gitignore
@rm -fr temp/template-mono-app/go.mod
@rm -fr temp/template-mono-app/go.sum
@sed -i 's/template-single/template-mono-app/g' temp/template-mono-app/main.go
@grep -irl 'template-single' temp| xargs sed -i '' -e 's/template-single/template-mono-app/g'
@cd temp && gf pack template-mono-app ../internal/packed/template-mono-app.go -n=packed -y
@rm -fr temp
Loading

0 comments on commit 4fdafa4

Please sign in to comment.