discentem / cavorite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle case where someone might try to retrieve a file two times

natewalck opened this issue · comments

Here is what happens if you try to retrieve the same file two times in a row:

$PANTRI_BIN --vv retrieve "/Users/nw/some_git_project/Nudge-1.1.11.81465.pkg.pfile"
INFO : 2023/05/05 12:10:40.454345 logger.go:344: Info verbosity set to 2
INFO : Downloading files from: http://127.0.0.1:9000/test
INFO : Downloading file: [/Users/nw/some_git_project/Nudge-1.1.11.81465.pkg.pfile]


$PANTRI_BIN --vv retrieve "/Users/nw/some_git_project/Nudge-1.1.11.81465.pkg.pfile"
INFO : 2023/05/05 12:10:47.168526 logger.go:344: Info verbosity set to 2
INFO : Downloading files from: http://127.0.0.1:9000/test
INFO : Downloading file: [/Users/nw/some_git_project/Nudge-1.1.11.81465.pkg.pfile]
INFO : /Users/nw/some_git_project/Nudge-1.1.11.81465.pkg already exists
Error: invalid argument
Usage:
   retrieve [flags]

Flags:
  -h, --help   help for retrieve

Global Flags:
      --debug   Run in debug mode
      --vv      Run in verbose logging mode

2023/05/05 12:10:47 invalid argument

Instead of "Error: Invalid argument" it should give the already exists message.

Fixed in #90