aboutsummaryrefslogtreecommitdiff
path: root/internal/apply
diff options
context:
space:
mode:
Diffstat (limited to 'internal/apply')
-rw-r--r--internal/apply/apply.go2
-rw-r--r--internal/apply/fs.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/apply/apply.go b/internal/apply/apply.go
index 5624b27..684641e 100644
--- a/internal/apply/apply.go
+++ b/internal/apply/apply.go
@@ -180,7 +180,7 @@ func runFileStep(step plan.Step) StepResult {
return StepResult{Step: step, Status: "failed", Detail: err.Error()}
}
- made, err := mkdirAllTracked(filepath.Dir(dst))
+ made, err := MkdirAllTracked(filepath.Dir(dst))
if err != nil {
return StepResult{Step: step, Status: "failed", Detail: err.Error(), Made: made, DisplacedEntry: displacedEntry}
}
diff --git a/internal/apply/fs.go b/internal/apply/fs.go
index 823d5c8..56737e8 100644
--- a/internal/apply/fs.go
+++ b/internal/apply/fs.go
@@ -201,11 +201,11 @@ func splitExt(name string) (stem, ext string) {
return name[:i], name[i:]
}
-// mkdirAllTracked creates dir and any missing ancestors (mode 0755),
+// MkdirAllTracked creates dir and any missing ancestors (mode 0755),
// returning every directory it actually created, outermost first, so undo
// can later remove the empty ones again. A directory that already existed
// is not included, and nothing is created or returned on error.
-func mkdirAllTracked(dir string) ([]string, error) {
+func MkdirAllTracked(dir string) ([]string, error) {
dir = filepath.Clean(dir)
if fi, err := os.Stat(dir); err == nil {
if !fi.IsDir() {
@@ -219,7 +219,7 @@ func mkdirAllTracked(dir string) ([]string, error) {
parent := filepath.Dir(dir)
var made []string
if parent != dir {
- parentMade, err := mkdirAllTracked(parent)
+ parentMade, err := MkdirAllTracked(parent)
if err != nil {
return nil, err
}