(_ *cobra.Command, args []string)
| 138 | } |
| 139 | |
| 140 | func getHashCommandFunc(_ *cobra.Command, args []string) { |
| 141 | if len(args) < 1 { |
| 142 | log.Fatalf("Must provide at least 1 argument (got %v)", args) |
| 143 | } |
| 144 | dp := args[0] |
| 145 | if !strings.HasSuffix(dp, "db") { |
| 146 | dp = filepath.Join(snapDir(dp), "db") |
| 147 | } |
| 148 | if !existFileOrDir(dp) { |
| 149 | log.Fatalf("%q does not exist", dp) |
| 150 | } |
| 151 | |
| 152 | hash, err := getHash(dp) |
| 153 | if err != nil { |
| 154 | log.Fatal(err) |
| 155 | } |
| 156 | fmt.Printf("db path: %s\nHash: %d\n", dp, hash) |
| 157 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…