Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows path compatibility issue #53

Closed
Zhwt opened this issue Feb 21, 2020 · 3 comments
Closed

Windows path compatibility issue #53

Zhwt opened this issue Feb 21, 2020 · 3 comments

Comments

@Zhwt
Copy link

Zhwt commented Feb 21, 2020

First of all, thanks for the great work!

I'm using Windows 10 Enterprise Edition 1607 LTSB, and my .air.conf file is like:

root = "."
tmp_dir = "tmp"

[build]
cmd = "go build -o ./tmp/main.exe ."
bin = "tmp/main.exe"
full_bin = "tmp\main.exe"

It seems air is using cmd to spawn go processes, by default it will generate tmp is not recognized as an internal or external command error, so I changed the \ in full_bin property to /, others are the same as air_example.conf.

Then every time after I changed something, air reloads the peoject, and the console will output an error:

failed to remove C:\path\to\project\tmp\main.exe, error: remove C:\path\to\project\C:\path\
to\project\tmp\main.exe: The filename, directory name, or volume label syntax is incorrect.

It is removing C:\path\to\project\C:\path\to\project\tmp\main.exe while the correct file path is C:\path\to\project\tmp\main.exe. My condition is a little different from issue#2, I don't know why but my windows can remove a file that is in use. And besides the error message, everything just works fine, the program actually gets reloaded and serving correct contents.

@Zhwt
Copy link
Author

Zhwt commented Feb 21, 2020

The problem is probably related to

https://github.com/cosmtrek/air/blob/f5010ecb13e740523cbe8dbe175d3f07febad8af/runner/config.go#L192-L194

Both c.Root and c.Build.Bin are absolute paths.

@cosmtrek
Copy link
Collaborator

Sorry, I work on macOS and Debian all the time, not well known at Windows. I would greatly appreciate your contributions.

@xiantang
Copy link
Collaborator

#122 close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants