Convert all paths to absolute

To fix issue where folders were being linked as files
This commit is contained in:
2024-09-20 18:24:10 +02:00
parent 205f8314d6
commit 41123846d1

View File

@@ -28,6 +28,12 @@ func FileExists(path string) bool {
} }
func NormalizePath(input, workdir string) string { func NormalizePath(input, workdir string) string {
input = filepath.Clean(input)
input, err := filepath.Abs(input)
if err != nil {
log.Printf("Failed to get absolute path for %s%s%s: %s%+v%s", SourceColor, input, DefaultColor, ErrorColor, err, DefaultColor)
return input
}
input = filepath.ToSlash(input) input = filepath.ToSlash(input)
input = strings.ReplaceAll(input, "\"", "") input = strings.ReplaceAll(input, "\"", "")