Made Makefile work with windows
This commit is contained in:
parent
bb9f2ad740
commit
e7e415c25e
1 changed files with 21 additions and 8 deletions
|
@ -4,6 +4,25 @@ ifneq (,$(wildcard ./.env))
|
||||||
export
|
export
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
MAIN_PATH = /tmp/bin/main.exe
|
||||||
|
SYNC_ASSETS_COMMAND = go run github.com/makiuchi-d/arelo@v1.13.1 \
|
||||||
|
--target "./public" \
|
||||||
|
--pattern "**/*.js" \
|
||||||
|
--pattern "**/*.css" \
|
||||||
|
--delay "100ms" \
|
||||||
|
-- templ generate --notify-proxy
|
||||||
|
else
|
||||||
|
MAIN_PATH = tmp/bin/main
|
||||||
|
SYNC_ASSETS_COMMAND = go run github.com/cosmtrek/air@v1.51.0 \
|
||||||
|
--build.cmd "templ generate --notify-proxy" \
|
||||||
|
--build.bin "true" \
|
||||||
|
--build.delay "100" \
|
||||||
|
--build.exclude_dir "" \
|
||||||
|
--build.include_dir "public" \
|
||||||
|
--build.include_ext "js,css"
|
||||||
|
endif
|
||||||
|
|
||||||
# run templ generation in watch mode to detect all .templ files and
|
# run templ generation in watch mode to detect all .templ files and
|
||||||
# re-create _templ.txt files on change, then send reload event to browser.
|
# re-create _templ.txt files on change, then send reload event to browser.
|
||||||
# Default url: http://localhost:7331
|
# Default url: http://localhost:7331
|
||||||
|
@ -13,7 +32,7 @@ templ:
|
||||||
# run air to detect any go file changes to re-build and re-run the server.
|
# run air to detect any go file changes to re-build and re-run the server.
|
||||||
server:
|
server:
|
||||||
@go run github.com/cosmtrek/air@v1.51.0 \
|
@go run github.com/cosmtrek/air@v1.51.0 \
|
||||||
--build.cmd "go build --tags dev -o tmp/bin/main ./cmd/app/" --build.bin "tmp/bin/main" --build.delay "100" \
|
--build.cmd "go build --tags dev -o ${MAIN_PATH} ./cmd/app/" --build.bin "${MAIN_PATH}" --build.delay "100" \
|
||||||
--build.exclude_dir "node_modules" \
|
--build.exclude_dir "node_modules" \
|
||||||
--build.include_ext "go" \
|
--build.include_ext "go" \
|
||||||
--build.stop_on_error "false" \
|
--build.stop_on_error "false" \
|
||||||
|
@ -29,13 +48,7 @@ watch-esbuild:
|
||||||
|
|
||||||
# watch for any js or css change in the assets/ folder, then reload the browser via templ proxy.
|
# watch for any js or css change in the assets/ folder, then reload the browser via templ proxy.
|
||||||
sync_assets:
|
sync_assets:
|
||||||
go run github.com/cosmtrek/air@v1.51.0 \
|
${SYNC_ASSETS_COMMAND}
|
||||||
--build.cmd "templ generate --notify-proxy" \
|
|
||||||
--build.bin "true" \
|
|
||||||
--build.delay "100" \
|
|
||||||
--build.exclude_dir "" \
|
|
||||||
--build.include_dir "public" \
|
|
||||||
--build.include_ext "js,css"
|
|
||||||
|
|
||||||
# start the application in development
|
# start the application in development
|
||||||
dev:
|
dev:
|
||||||
|
|
Loading…
Reference in a new issue