Browse Source

fix path bug on windows

fix usage
pull/3184/head
guol-fnst 3 years ago
parent
commit
cd078471c4
  1. 7
      weed/command/update.go

7
weed/command/update.go

@ -75,7 +75,7 @@ func init() {
}
var cmdUpdate = &Command{
UsageLine: "update [-output=weed]",
UsageLine: "weed update -dir=/path/to/dir -name=name -version=x.xx",
Short: "get latest or specific version from https://github.com/chrislusf/seaweedfs",
Long: `get latest or specific version from https://github.com/chrislusf/seaweedfs`,
}
@ -97,14 +97,15 @@ func runUpdate(cmd *Command, args []string) bool {
*updateOpt.name = name
}
target := filepath.Join(*updateOpt.dir, *updateOpt.name)
if runtime.GOOS == "windows" {
if *updateOpt.name == name || *updateOpt.name == "" {
if target == path {
glog.Fatalf("On windows, name of the new weed shouldn't be same to the orignial name.")
return false
}
}
target := *updateOpt.dir + "/" + *updateOpt.name
glog.V(0).Infof("new weed will be saved to %s", target)
_, err := downloadRelease(context.Background(), target, *updateOpt.Version)

Loading…
Cancel
Save