Skip to content

Commit

Permalink
Add warning when use existing - file for downloading output file
Browse files Browse the repository at this point in the history
  • Loading branch information
athakur-reef committed Oct 17, 2023
1 parent 8679003 commit 8842d16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions b2/console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,11 +1369,13 @@ class DownloadFileMixin(
MaxDownloadStreamsMixin,
DownloadCommand,
):
@staticmethod
def correct_local_file_name(filename):
def correct_local_file_name(self, filename: str):
if filename != '-':
return filename
if os.path.exists('-'):
self._print_stderr(
"WARNING: Filename `-` won't be supported in the future and will be treated as stdout alias."
)
return filename
return 'CON' if platform.system() == 'Windows' else '/dev/stdout'

Expand Down

0 comments on commit 8842d16

Please sign in to comment.