Move demandDirectoryRoot into kyaml/filesys (#4677)

* Move demandDirectoryRoot into kyaml/filesys

* Make root directory platform-agnostic

Support windows root directory. Dogfood own error package.

* Use cleaner windows support implementation

* Address feedback

* Address feedback x2

* Re-apply go.sum changes to avoid CI errors
This commit is contained in:
Anna Song
2022-06-30 14:12:07 -04:00
committed by GitHub
parent 7e0fd02783
commit d1102fb726
49 changed files with 368 additions and 145 deletions

View File

@@ -0,0 +1,17 @@
// Copyright 2022 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
//go:build !windows
// +build !windows
package filesys
import (
"path/filepath"
"testing"
)
func getOSRoot(t *testing.T) string {
t.Helper()
return string(filepath.Separator)
}