Skip to content
Permalink
Browse files

add support for upgrading in-place up(1). Closes #607

  • Loading branch information...
tj committed Mar 3, 2018
1 parent 526000d commit 57bf244ca677c95a9298cf7efed0f46cfa9755aa
Showing with 11 additions and 1 deletion.
  1. +11 −1 internal/cli/upgrade/upgrade.go
@@ -1,6 +1,9 @@
package upgrade

import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"
@@ -89,8 +92,15 @@ func init() {
return errors.Wrap(err, "downloading tarball")
}

// determine path
path, err := exec.LookPath(os.Args[0])
if err != nil {
return errors.Wrap(err, "looking up executable path")
}
dst := filepath.Dir(path)

// install it
if err := p.Install(tarball); err != nil {
if err := p.InstallTo(tarball, dst); err != nil {
return errors.Wrap(err, "installing")
}

0 comments on commit 57bf244

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