feat: add native Windows hierarchy test harness
This commit is contained in:
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -21,10 +22,13 @@ func validateAbsolutePath(name, value string, platform Platform, allowEmpty bool
|
||||
}
|
||||
return cleanWindowsPath(value), nil
|
||||
}
|
||||
if !filepath.IsAbs(value) {
|
||||
// Config parsing can validate an inactive Unix shell path while running on
|
||||
// Windows. filepath follows the host OS, whereas the config field's stated
|
||||
// platform is Unix, so use slash-path semantics here.
|
||||
if !path.IsAbs(value) {
|
||||
return "", fmt.Errorf("%s must be an absolute Unix path", name)
|
||||
}
|
||||
return filepath.Clean(value), nil
|
||||
return path.Clean(value), nil
|
||||
}
|
||||
|
||||
func isWindowsAbsolute(value string) bool {
|
||||
|
||||
Reference in New Issue
Block a user