X-Git-Url: https://ruderich.org/simon/gitweb/?p=safcm%2Fsafcm.git;a=blobdiff_plain;f=cmd%2Fsafcm%2Fconfig%2Ffiles.go;h=7ffa8b201cfeb5548cb0d2356f19677931218542;hp=8f637701a60735c25ebb63969d075b8e1526edd9;hb=afb7e8e2c886c9907f9aee8f9c32baabcbbcf997;hpb=0d6364c68d5e523f3c69b93d48cadfb7c150b652 diff --git a/cmd/safcm/config/files.go b/cmd/safcm/config/files.go index 8f63770..7ffa8b2 100644 --- a/cmd/safcm/config/files.go +++ b/cmd/safcm/config/files.go @@ -21,7 +21,9 @@ import ( "fmt" "io/fs" "os" + slashpath "path" "path/filepath" + "runtime" "ruderich.org/simon/safcm" ) @@ -84,12 +86,13 @@ via "safcm fixperms". return fmt.Errorf("%q: file type not supported", path) } - // Convert to absolute path as used on the target host + // Convert to absolute and slash-separated path as used on the + // target host x, err := filepath.Rel(basePath, path) if err != nil { return err } - x = filepath.Join("/", x) + x = slashpath.Join("/", filepath.ToSlash(x)) files[x] = &safcm.File{ Path: x,