You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not convert volume target path to Windows style, implement tilde expansion for Windows (#2488)
Since we deal with Linux containers, the volume target path should always be a Unix style path, even on Windows. Prior to this, the code would convert the target path to a Windows style path on Windows hosts due to the use of filepath.Clean. This PR changes the code to use path.Clean for the target instead, which always produces a Unix style path. Pre-existing validation ensures that the user cannot pass Windows style paths as input.
Another issue which was discovered by @danbarr as part of this was inconsistent handling of tilde expansion (i.e. converting ~/foo to an absolute path with the user's home folder). This was exacerbated by ToolHive using hand-rolled code to do absolute path expansion when there is a function in the Go standard library to do this. The new code explicitly checks to see if the path starts with ~ on Windows hosts, replaces it with the contents of the USERPROFILE env var if true, and then uses the Go standard library to convert to an absolute path.
0 commit comments