air-verse / air

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

deleted full_bin instead of bin upon reload #525

Open mundey opened 7 months ago

mundey commented 7 months ago

Hello devs,

The program is really cool but i found a weird case where it deletes my file. I'm using v1.49.0, built with Go go1.20.2

air toml is configured this way

cmd = "go build -o ./tmp/main ./cmd/web/"
# Binary file yields from `cmd`.
bin = "tmp/main"
# Customize binary.
full_bin = ". .env && DB_SECRET=${DB_SECRET} ./tmp/main -port=${APP_PORT} -dsn=${DSN}"

upon changing a file, it gives error (even though it restarts anyway)

failed to remove . .env && DB_SECRET=${DB_SECRET} ./tmp/main -port=${APP_PORT} -dsn=${DSN}, error: remove .: invalid argument

I tried another way, wrote a shell file and passed to full_bin. Upon file change, it deleted the file.

upon file change, air should remove bin and not full_bin

Is there a configuration for remove params or this required a fix.