diff --git a/pkg/commands/copy_test.go b/pkg/commands/copy_test.go index 0519f6682..b60fb951d 100644 --- a/pkg/commands/copy_test.go +++ b/pkg/commands/copy_test.go @@ -30,17 +30,17 @@ import ( var copyTests = []struct { name string - SourcesAndDest []string + sourcesAndDest []string expectedDest []string }{ { name: "copy foo into tempCopyExecuteTest/", - SourcesAndDest: []string{"foo", "tempCopyExecuteTest/"}, + sourcesAndDest: []string{"foo", "tempCopyExecuteTest/"}, expectedDest: []string{"foo"}, }, { name: "copy foo into tempCopyExecuteTest", - SourcesAndDest: []string{"foo", "tempCopyExecuteTest"}, + sourcesAndDest: []string{"foo", "tempCopyExecuteTest"}, expectedDest: []string{"tempCopyExecuteTest"}, }, } @@ -60,13 +60,13 @@ func TestCopyExecuteCmd(t *testing.T) { cmd := CopyCommand{ cmd: &instructions.CopyCommand{ - SourcesAndDest: test.SourcesAndDest, + SourcesAndDest: test.sourcesAndDest, }, buildcontext: "../../integration/context/", } buildArgs := copySetUpBuildArgs() - dest := cfg.WorkingDir + test.SourcesAndDest[len(test.SourcesAndDest)-1] + dest := cfg.WorkingDir + test.sourcesAndDest[len(test.sourcesAndDest)-1] os.RemoveAll(dest) diff --git a/pkg/util/fs_util.go b/pkg/util/fs_util.go index a4d7996f8..aa4289315 100644 --- a/pkg/util/fs_util.go +++ b/pkg/util/fs_util.go @@ -193,7 +193,6 @@ func extractFile(dest string, hdr *tar.Header, tr io.Reader) error { fi, err := os.Stat(dir) if os.IsNotExist(err) || !fi.IsDir() { logrus.Infof("base %s for file %s does not exist. Creating.", base, path) - //os.RemoveAll(dir) if err := os.MkdirAll(dir, 0755); err != nil { return err }