Skip to content

Commit

Permalink
refactor: update build command and file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Feb 3, 2024
1 parent b81f873 commit ffceb1a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tmp_dir = "tmp_app"

[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -o ./tmp_app/app/engine ./cmd/main.go"
cmd = "go build -o ./tmp_app/app/engine ./cmd/backend/main.go"
# Binary file yields from `cmd`.
bin = "tmp_app/app"
# Customize binary.
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.PHONY: help install build serve generate dev-up dev-migrate dev-down dev-teardown stage-up test run docs bot

BLUE = \033[34m
NC = \033[0m

Expand Down Expand Up @@ -49,7 +51,7 @@ run: ## Run the application
./script/run.sh dev run

docs: install ## Generate the swagger docs
swag init --parseDependency --parseInternal -g ./cmd/main.go
swag init --parseDependency --parseInternal -g ./cmd/backend/main.go

bot: ## Run the bot
./script/run.sh dev bot
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions pkg/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
"gorm.io/gorm"
)

var (
ErrEventExceedsMaxSubscriptions = errors.New("exceeds the maximum number of subscriptions")
)

func NewUserService(db *gorm.DB, cache *redis.Client) model.UserService {
return &UserServiceImpl{
db: db,
Expand Down
6 changes: 3 additions & 3 deletions script/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ case "$action" in
migrate|run|serve|test|bot)
export_env $mode
if [ "$action" = "migrate" ]; then
go run ./cmd/migrate.go
go run ./cmd/migrate/migrate.go
elif [ "$action" = "run" ]; then
go run ./cmd/main.go
go run ./cmd/backend/main.go
elif [ "$action" = "bot" ]; then
go run ./cmd/notification.go
go run ./cmd/notifier/main.go
elif [ "$action" = "serve" ]; then
air
elif [ "$action" = "test" ]; then
Expand Down

0 comments on commit ffceb1a

Please sign in to comment.