air
air copied to clipboard
Adding flags to compiled binary adds .exe to the end
In a Windows environment, using the following in the toml file:
bin = "tmp\\main.exe --read-envar-file=envar.yaml"
results in error because air is adding .exe at the very end.
I don't believe it should be doing this. It should be the responsibility of the user to make sure their bin is proper.
You should probably use full_bin in the toml for that use case.
Abominably, full_bin is also added .exe.
There is a workaround:
full_bin = "tmp\\main.exe --read-envar-file=envar.yaml\nrem "
This string is passed to the command cmd.exe /C , and cmd does not execute the string after a newline
(the string after newline which is rem .exe is a comment line, so it has no effect if it is executed).
hotbuild.ffactory.org
I was wondering why I couldn't get air to work properly on my Windows PC.
@makiuchi-d Thanks, that's a decent workaround for now.
Had to change mine from full_bin = "./tmp/main serve" to full_bin = "./tmp/main serve\nrem "
Seems like it's adding .exe to the end of full_bin for windows here: https://github.com/cosmtrek/air/blob/4f76c39874dca4266f2f05dff613e8bde4253e5a/runner/util.go#L220
Kind of annoying since I don't even need .exe at all.