Partial fix for #2648 on Windows only.

Signed-off-by: Eric <ericwj@users.noreply.github.com>
This commit is contained in:
Eric 2020-07-23 22:21:22 +02:00
parent 280e7230d5
commit c2e2c0b9f6
1 changed files with 3 additions and 7 deletions

View File

@ -280,13 +280,9 @@ func ResolveAndValidateContextPath(givenContextDir string) (string, error) {
} }
// The context dir might be a symbolic link, so follow it to the actual // The context dir might be a symbolic link, so follow it to the actual
// target directory. // target directory. This still forgets the configured context directory,
// // but leave this for now on *nix only.
// FIXME. We use isUNC (always false on non-Windows platforms) to workaround if runtime.GOOS != "windows" {
// an issue in golang. On Windows, EvalSymLinks does not work on UNC file
// paths (those starting with \\). This hack means that when using links
// on UNC paths, they will not be followed.
if !isUNC(absContextDir) {
absContextDir, err = filepath.EvalSymlinks(absContextDir) absContextDir, err = filepath.EvalSymlinks(absContextDir)
if err != nil { if err != nil {
return "", errors.Errorf("unable to evaluate symlinks in context path: %v", err) return "", errors.Errorf("unable to evaluate symlinks in context path: %v", err)