From fce8800e4c81c249bede319b0953e57f3ed36182 Mon Sep 17 00:00:00 2001 From: y_uuki Date: Thu, 13 Jul 2017 12:44:03 +0900 Subject: [PATCH 1/2] Avoid to join with release path because prunedDirs already joined with release path --- release/release.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.go b/release/release.go index cf11f06..04d21dc 100644 --- a/release/release.go +++ b/release/release.go @@ -114,7 +114,7 @@ func (r *Release) Cleanup(keep int) error { if len(dirs) > 0 { var dirsStr string for _, dir := range dirs { - dirsStr = strings.Join([]string{dirsStr, filepath.Join(r.ReleasesPath, dir)}, " ") + dirsStr = strings.Join([]string{dirsStr, dir}, " ") } rmCmd := fmt.Sprintf("rm -fr %s", dirsStr) if err := osutil.RunCmd("/bin/bash", "-c", rmCmd); err != nil { From 1a776b5d7f854836999750a21c0e13cc4ccad48f Mon Sep 17 00:00:00 2001 From: y_uuki Date: Thu, 13 Jul 2017 12:46:05 +0900 Subject: [PATCH 2/2] Log deleted dirs --- release/release.go | 1 + 1 file changed, 1 insertion(+) diff --git a/release/release.go b/release/release.go index 04d21dc..8b4d799 100644 --- a/release/release.go +++ b/release/release.go @@ -120,6 +120,7 @@ func (r *Release) Cleanup(keep int) error { if err := osutil.RunCmd("/bin/bash", "-c", rmCmd); err != nil { return errors.Wrapf(err, "Failed to remove %s", dirsStr) } + fmt.Printf("deleted: %s\n", dirsStr) } return nil