mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 11:56:08 +02:00
feat: include func support (#1187)
* feat: include func support Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -30,6 +30,7 @@ type FileSystem struct {
|
||||
Glob func(string) ([]string, error)
|
||||
FileExistsAt func(string) bool
|
||||
DirectoryExistsAt func(string) bool
|
||||
Dir func(string) string
|
||||
Stat func(string) (os.FileInfo, error)
|
||||
Getwd func() (string, error)
|
||||
Chdir func(string) error
|
||||
@@ -41,11 +42,11 @@ func DefaultFileSystem() *FileSystem {
|
||||
dfs := FileSystem{
|
||||
ReadDir: os.ReadDir,
|
||||
DeleteFile: os.Remove,
|
||||
Stat: os.Stat,
|
||||
Glob: filepath.Glob,
|
||||
Getwd: os.Getwd,
|
||||
Chdir: os.Chdir,
|
||||
EvalSymlinks: filepath.EvalSymlinks,
|
||||
Dir: filepath.Dir,
|
||||
}
|
||||
|
||||
dfs.Stat = dfs.stat
|
||||
@@ -96,6 +97,9 @@ func FromFileSystem(params FileSystem) *FileSystem {
|
||||
if params.EvalSymlinks != nil {
|
||||
dfs.EvalSymlinks = params.EvalSymlinks
|
||||
}
|
||||
if params.Dir != nil {
|
||||
dfs.Dir = params.Dir
|
||||
}
|
||||
return dfs
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user