Remove unecessary conditions for module manifest read and write functions
This commit is contained in:
parent
43b855743b
commit
26305a83a3
|
@ -82,11 +82,9 @@ func ReadManifestSnapshot(r io.Reader) (Manifest, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure Windows is using the proper modules directory format after
|
// Ensure Windows is using the proper modules path format after
|
||||||
// reading the modules manifest
|
// reading the modules manifest Dir records
|
||||||
if string(filepath.Separator) != "/" {
|
record.Dir = filepath.FromSlash(record.Dir)
|
||||||
record.Dir = filepath.FromSlash(record.Dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, exists := new[record.Key]; exists {
|
if _, exists := new[record.Key]; exists {
|
||||||
// This should never happen in any valid file, so we'll catch it
|
// This should never happen in any valid file, so we'll catch it
|
||||||
|
@ -124,10 +122,8 @@ func (m Manifest) WriteSnapshot(w io.Writer) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure Dir is written in a format that can be read by Linux and
|
// Ensure Dir is written in a format that can be read by Linux and
|
||||||
// Windows nodes
|
// Windows nodes for remote and apply compatibility
|
||||||
if string(filepath.Separator) != "/" {
|
record.Dir = filepath.ToSlash(record.Dir)
|
||||||
record.Dir = filepath.ToSlash(record.Dir)
|
|
||||||
}
|
|
||||||
write.Records = append(write.Records, record)
|
write.Records = append(write.Records, record)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue