Documentation
¶
Overview ¶
Package filesystem provides generic filesystem operations.
Index ¶
- func CopyFile(src, dest string) error
- func MoveAndMerge(sourceDir, targetDir string) error
- func MoveAndMergeWithKeep(sourceDir, targetDir, libraryRoot string, keepFunc func(string) bool) error
- func RemoveEmptyDirs(targetPath, root string, keepFunc func(string) bool) error
- func Unzip(ctx context.Context, src, dest string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MoveAndMerge ¶
MoveAndMerge moves entries from sourceDir to targetDir. It merges directories recursively if they exist in both source and target. If an entry in sourceDir is a file that already exists in targetDir, it returns an error instead of overwriting it. It also returns an error if sourceDir and targetDir are the same. TODO(https://github.com/googleapis/librarian/issues/6627): Deprecate and remove MoveAndMerge after MoveAndMergeWithKeep is in production across all generators.
func MoveAndMergeWithKeep ¶ added in v0.25.0
func MoveAndMergeWithKeep(sourceDir, targetDir, libraryRoot string, keepFunc func(string) bool) error
MoveAndMergeWithKeep moves entries from sourceDir to targetDir. It merges directories recursively if they exist in both source and target. Existing target files are preserved if keepFunc returns true, otherwise they are overwritten.
func RemoveEmptyDirs ¶ added in v0.29.0
RemoveEmptyDirs walks the targetPath and removes empty subdirectories bottom-up. It preserves directories if keepFunc returns true. root is used to calculate relative paths passed to keepFunc.
Types ¶
This section is empty.