air-verse / air

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

Using the `air` cli on Windows breaks when providing nested paths to `build.bin` #589

Open ZanzyTHEbar opened 1 month ago

ZanzyTHEbar commented 1 month ago

Example 1.

air --root "." --testdata_dir "testdata" --tmp_dir "tmp" --build.cmd "make build" --build.bin "bin/hbat-blmp-api-windows.exe"

Result:

building...
CMD will not recognize non .exe file for execution, path: make build
Building hbat-blmp-api-windows.exe ...
running...
'bin' is not recognized as an internal or external command,
operable program or batch file.
Process Exit with Code: 1

Example 2.

air --root "." --testdata_dir "testdata" --tmp_dir "tmp" --build.cmd "make build" --build.bin "./bin/hbat-blmp-api-windows.exe"

Result:

building...
CMD will not recognize non .exe file for execution, path: make build
Building hbat-blmp-api-windows.exe ...
running...
'.' is not recognized as an internal or external command,
operable program or batch file.

Example 3.

air --root "." --testdata_dir "testdata" --tmp_dir "tmp" --build.cmd "make build" --build.bin "bin\hbat-blmp-api-windows.exe"

Result: The only successful run. I have to use bin\<binary name> with the windows path separator.

It seems that the universal path separator / is being split for some reason. When i use \ it can find the directory. When i supply bin/<binary-name> to the .air.toml file everything works fine. So, something in the cli prevents the universale path separator from working properly.

However, i need to use the cli as the binary name is being generated dynamically, relative to some build conditions.