Skip to content
Permalink
Browse files

Remove mkdir redundancy (#444)

* Create plugin directory without version

* Add pluginDir to upgrade command

Update some of the logging around installation

* Strip version info from installDir

* Change installation directory to directory in logs
  • Loading branch information
chriskim06 authored and k8s-ci-robot committed Dec 30, 2019
1 parent 885f5ad commit e0a3f6fc7b766ef36150752e1be2cb37872af75c
Showing with 4 additions and 3 deletions.
  1. +4 −3 internal/installation/move.go
@@ -153,9 +153,10 @@ func moveAllFiles(fromDir, toDir string, fos []index.FileOperation) error {

// moveToInstallDir moves plugins from srcDir to dstDir (created in this method) with given FileOperation.
func moveToInstallDir(srcDir, installDir string, fos []index.FileOperation) error {
klog.V(4).Infof("Creating plugin installation directory %q", installDir)
if err := os.MkdirAll(installDir, 0755); err != nil {
return errors.Wrapf(err, "error creating installation directory at %q", installDir)
installationDir := filepath.Dir(installDir)
klog.V(4).Infof("Creating directory %q", installationDir)
if err := os.MkdirAll(installationDir, 0755); err != nil {
return errors.Wrapf(err, "error creating directory at %q", installationDir)
}

tmp, err := ioutil.TempDir("", "krew-temp-move")

0 comments on commit e0a3f6f

Please sign in to comment.
You can’t perform that action at this time.