air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.38k stars 772 forks source link

Air rebuilds but does not run the binary #482

Closed Oudwins closed 8 months ago

Oudwins commented 8 months ago

This may be a naive question since I am pretty new to go & air.

I am trying to set up live reloading but cannot get it to work. Specifically air seems to watch the files correctly & compile correctly but never actually runs the code.

The only thing I changed from the default config is the cmd path since for my project I have the following folder structure

cmd/server/main.go db views ...

Config file for completeness

root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
  args_bin = []
  bin = "./tmp/main"
  cmd = "go build -o ./tmp/main ./cmd/server/*.go"
  delay = 1000
  exclude_dir = ["assets", "tmp", "vendor", "testdata"]
  exclude_file = []
  exclude_regex = ["_test.go"]
  exclude_unchanged = false
  follow_symlink = false
  full_bin = ""
  include_dir = []
  include_ext = ["go", "tpl", "tmpl", "html"]
  include_file = []
  kill_delay = "0s"
  log = "build-errors.log"
  poll = false
  poll_interval = 0
  post_cmd = []
  pre_cmd = []
  rerun = false
  rerun_delay = 500
  send_interrupt = false
  stop_on_error = false

[color]
  app = ""
  build = "yellow"
  main = "magenta"
  runner = "green"
  watcher = "cyan"

[log]
  main_only = false
  time = false

[misc]
  clean_on_exit = false

[screen]
  clear_on_rebuild = false
  keep_scroll = true
xiantang commented 8 months ago

could u check ./tmp folder, Does it contain your binary?