Skip to content

Commit

Permalink
Merge pull request #274 from 0chain/modify/datetime
Browse files Browse the repository at this point in the history
Modify/datetime
  • Loading branch information
lpoli authored Jul 28, 2022
2 parents 9a07079 + 5f1d70e commit 5aa363a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cmd/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"path/filepath"
"sync"

"github.com/0chain/gosdk/zboxcore/sdk"
Expand Down Expand Up @@ -38,6 +39,11 @@ var renameCmd = &cobra.Command{
}
remotepath := cmd.Flag("remotepath").Value.String()
destname := cmd.Flag("destname").Value.String()
oldName := filepath.Base(remotepath)
if oldName == destname {
fmt.Println(remotepath + " renamed")
return
}
commit, _ := cmd.Flags().GetBool("commit")

statsMap, err := allocationObj.GetFileStats(remotepath)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.8.6-0.20220726210139-0aece4fa50c5
github.com/0chain/gosdk v1.8.6-0.20220727101848-c573a174d64b
github.com/icza/bitio v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.5.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.8.6-0.20220726210139-0aece4fa50c5 h1:Ayg5bYIEtjXzTzOHxlEkLvjYctl8jPp0ZO9nQy6hW3E=
github.com/0chain/gosdk v1.8.6-0.20220726210139-0aece4fa50c5/go.mod h1:JeaXA7gbncHoYbKixUnM58+7S2E9z7IKYY+fV0IQJ/o=
github.com/0chain/gosdk v1.8.6-0.20220727101848-c573a174d64b h1:OmkkZuQBCaZPyqtX6YvIlR7BTZ2a1n7CXILgNji0GjQ=
github.com/0chain/gosdk v1.8.6-0.20220727101848-c573a174d64b/go.mod h1:JeaXA7gbncHoYbKixUnM58+7S2E9z7IKYY+fV0IQJ/o=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o=
Expand Down

0 comments on commit 5aa363a

Please sign in to comment.