mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix path bug on windows
fix usage
This commit is contained in:
parent
995e221e97
commit
cd078471c4
|
@ -75,7 +75,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdUpdate = &Command{
|
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",
|
Short: "get latest or specific version from https://github.com/chrislusf/seaweedfs",
|
||||||
Long: `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
|
*updateOpt.name = name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target := filepath.Join(*updateOpt.dir, *updateOpt.name)
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
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.")
|
glog.Fatalf("On windows, name of the new weed shouldn't be same to the orignial name.")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target := *updateOpt.dir + "/" + *updateOpt.name
|
|
||||||
glog.V(0).Infof("new weed will be saved to %s", target)
|
glog.V(0).Infof("new weed will be saved to %s", target)
|
||||||
|
|
||||||
_, err := downloadRelease(context.Background(), target, *updateOpt.Version)
|
_, err := downloadRelease(context.Background(), target, *updateOpt.Version)
|
||||||
|
|
Loading…
Reference in a new issue