mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
feat(makefile): add tmux-based dev environment (#1844)
- Added touch command to preserve web/dist/.gitkeep during build
This commit is contained in:
parent
ee04c61a54
commit
2a9a890e97
1 changed files with 13 additions and 1 deletions
14
Makefile
14
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: test
|
||||
.PHONY: all deps test build build/app build/ctl build/web build/docker clean install dev
|
||||
.POSIX:
|
||||
.SUFFIXES:
|
||||
|
||||
|
@ -31,6 +31,7 @@ build/ctl:
|
|||
|
||||
build/web:
|
||||
pnpm --dir web run build
|
||||
@touch web/dist/.gitkeep 2>/dev/null # To avoid accidental commit of the deletionn
|
||||
|
||||
build/docker:
|
||||
docker build -t autobrr:dev -f Dockerfile . --build-arg GIT_TAG=$(GIT_TAG) --build-arg GIT_COMMIT=$(GIT_COMMIT)
|
||||
|
@ -42,3 +43,14 @@ install: all
|
|||
echo $(DESTDIR)$(PREFIX)/$(BINDIR)
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
|
||||
cp -f bin/$(SERVICE) $(DESTDIR)$(PREFIX)/$(BINDIR)
|
||||
|
||||
dev:
|
||||
@if ! command -v tmux >/dev/null 2>&1; then \
|
||||
echo "tmux is not installed. Please install it to use dev mode."; \
|
||||
echo "On Ubuntu/Debian: sudo apt install tmux"; \
|
||||
echo "On macOS: brew install tmux"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@tmux new-session -d -s autobrr-dev 'pnpm --dir web dev'
|
||||
@tmux split-window -h 'go run cmd/$(SERVICE)/main.go'
|
||||
@tmux -2 attach-session -d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue