air-verse / air

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

pre_cmd fails #565

Open petereichinger opened 3 months ago

petereichinger commented 3 months ago

I created a basic air config with air init. Then i try to add a simple pre_cmd before cmd in the .air.toml file:

pre_cmd = ["echo 'hello air' > pre_cmd.txt"]

Now air does not work anymore (config is not parsed correctly and only defaults are used see #516

What do I do wrong here?

I use version 1.51.0 and use NixOs

petereichinger commented 3 months ago

If anyone wants to see the code (i commented out the pre_cmd) https://github.com/petereichinger/videoplayer . I currently run templ generate using cmd as a workaround. pre_cmd would be preferable

RedCrazyGhost commented 2 months ago

I tried it on my side pre_cmd and it works fine on my side, .air.toml should be in the same directory as main.go.

Linkinlog commented 1 month ago

Experiencing the same issue, I have my air.toml in my root directory with the main.go im trying to execute in cmd/client/main.go using cmd = "go build -o ./tmp/main cmd/client/main.go".

Tested using the default as well, and without pre_cmd = ["echo 'hello air' > pre_cmd.txt"], everything works fine, with it however it seems to disregard my custom cmd and fails saying there are no Go files in the directory