air-verse / air

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

Support Pre & Post build scripts #453

Closed kareemmahlees closed 10 months ago

kareemmahlees commented 11 months ago

Context

I was creating a fiber API and wanted to run the swag fmt and swag init commands before each build.

Wanted Solution

[build]
    pre_cmd = [ "swag fmt", "swag init" ] 
    cmd = "go build -o ./tmp/main.exe ."
    post_cmd = [ " some other scripts " ]

If the maintainers are ok with this you can assign this to me and I will happily work on it :smile:

xiantang commented 10 months ago

If you have submitted a PR and have sufficient unit tests, I am happy to merge it