Add contained home file endpoint

This commit is contained in:
2026-11-07 00:53:15 +00:00
parent f4ba2ab25e
commit bfe89432bb
6 changed files with 225 additions and 1 deletions
+5 -1
View File
@@ -442,7 +442,7 @@ func resolveChatDirectory(directory string) (string, error) {
// location. It is resolved through the standard library so it never falls back
// to the process working directory.
func OperatorHomeDirectory() (string, error) {
home, err := os.UserHomeDir()
home, err := operatorHomeDirectory()
if err != nil {
return "", errors.New("resolve operator home directory: " + err.Error())
}
@@ -451,3 +451,7 @@ func OperatorHomeDirectory() (string, error) {
}
return home, nil
}
// operatorHomeDirectory is a seam for tests of filesystem endpoints that are
// rooted at the operator's home directory.
var operatorHomeDirectory = os.UserHomeDir