SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix path bug on windows fix usage
guol-fnstcd078471c4a3
diff --git a/weed/command/update.go b/weed/command/update.goindex df5988b6e8..8e0a76016c 100644--- a/weed/command/update.go+++ b/weed/command/update.go@@ -69,13 +69,13 @@ func init() {path, _ := os.Executable()_, name := filepath.Split(path)updateOpt.dir = cmdUpdate.Flag.String("dir", filepath.Dir(path), "directory to save new weed.")- updateOpt.name = cmdUpdate.Flag.String("name", name, "name of new weed.On windows, name shouldn't be same to the orignial name.")+ updateOpt.name = cmdUpdate.Flag.String("name", name, "name of new weed. On windows, name shouldn't be same to the orignial name.")updateOpt.Version = cmdUpdate.Flag.String("version", "0", "specific version of weed you want to download. If not specified, get the latest version.")cmdUpdate.Run = runUpdate}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.nameglog.V(0).Infof("new weed will be saved to %s", target)_, err := downloadRelease(context.Background(), target, *updateOpt.Version)