Skip to content

Commit c32b5cd

Browse files
committed
fix: use inline PATH for GOBIN in generated Makefile
The `export PATH := $(GOBIN):$(PATH)` approach does not propagate to recipe commands in Make. Use inline `PATH="$(GOBIN):$$PATH"` on each command that needs wgo/templ so they are always found after go install.
1 parent 07c8cd4 commit c32b5cd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

catuaba.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() {
2929
app := &cli.App{
3030
Name: "catuaba",
3131
Usage: "Build full-stack Go web apps in minutes, not days",
32-
Version: "0.1.3",
32+
Version: "0.1.4",
3333
Commands: []*cli.Command{
3434
{
3535
Name: "mcp",

generator/templates/application/Makefile.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
APP_NAME={{.Name}}
44
GOBIN=$(shell go env GOPATH)/bin
5-
export PATH := $(GOBIN):$(PATH)
65

76
## dev: Start development with hot reload (templ + tailwind + go)
87
dev:
98
@command -v wgo >/dev/null 2>&1 || { echo "Installing wgo..."; go install github.com/bokwoon95/wgo@latest; }
109
@command -v templ >/dev/null 2>&1 || { echo "Installing templ..."; go install github.com/a-h/templ/cmd/templ@latest; }
11-
@wgo -file .go -file .templ templ generate :: \
10+
@PATH="$(GOBIN):$$PATH" wgo -file .go -file .templ templ generate :: \
1211
wgo run . :: \
1312
wgo -file .templ -file .css npx @tailwindcss/cli -i static/css/input.css -o static/css/app.css --watch
1413

@@ -19,7 +18,7 @@ setup:
1918

2019
## build: Build the application binary
2120
build:
22-
@templ generate
21+
@PATH="$(GOBIN):$$PATH" templ generate
2322
@npx @tailwindcss/cli -i static/css/input.css -o static/css/app.css --minify
2423
@go build -ldflags="-w -s" -o ./bin/$(APP_NAME) .
2524

0 commit comments

Comments
 (0)