Skip to content

Commit

Permalink
remove air | fix run backend command
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Mar 19, 2024
1 parent bdc7b2d commit b3a7aa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 49 deletions.
43 changes: 0 additions & 43 deletions backend/.air.toml

This file was deleted.

16 changes: 10 additions & 6 deletions cli/commands/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ func BackendCommand() *cli.Command {
Category: "Development",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "use-dev-dot-env",
Usage: "Use the .env file in the backend directory",
Aliases: []string{"d"},
Name: "d",
Usage: "Use the .env.dev file in the backend directory",
},
},
Action: func(c *cli.Context) error {
err := RunBackend()
err := RunBackend(c.Bool("d"))
if err != nil {
return cli.Exit(err.Error(), 1)
}
Expand All @@ -34,8 +33,13 @@ func BackendCommand() *cli.Command {
return command
}

func RunBackend() error {
cmd := exec.Command("air")
func RunBackend(useDevDotEnv bool) error {
cmd := exec.Command("go", "run", "main.go")

if useDevDotEnv {
cmd.Args = append(cmd.Args, "--use-dev-dot-env")
}

cmd.Dir = BACKEND_SRC_DIR
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit b3a7aa3

Please sign in to comment.