ssh_theater: fix tests
diff --git a/dockerimg/ssh_theater.go b/dockerimg/ssh_theater.go
index 0054205..8a2e94b 100644
--- a/dockerimg/ssh_theater.go
+++ b/dockerimg/ssh_theater.go
@@ -68,7 +68,8 @@
func newSSHTheatherWithDeps(cntrName, sshHost, sshPort string, fs FileSystem, kg KeyGenerator) (*SSHTheater, error) {
base := filepath.Join(os.Getenv("HOME"), ".config", "sketch")
if _, err := fs.Stat(base); err != nil {
- if err := fs.Mkdir(base, 0o777); err != nil {
+
+ if err := fs.MkdirAll(base, 0o777); err != nil {
return nil, fmt.Errorf("couldn't create %s: %w", base, err)
}
}
@@ -422,11 +423,16 @@
type FileSystem interface {
Stat(name string) (fs.FileInfo, error)
Mkdir(name string, perm fs.FileMode) error
+ MkdirAll(name string, perm fs.FileMode) error
ReadFile(name string) ([]byte, error)
WriteFile(name string, data []byte, perm fs.FileMode) error
OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
}
+func (fs *RealFileSystem) MkdirAll(name string, perm fs.FileMode) error {
+ return os.MkdirAll(name, perm)
+}
+
// RealFileSystem is the default implementation of FileSystem that uses the OS
type RealFileSystem struct{}