in st, skips directory creation when streaming to standard out
This commit is contained in:
parent
84aa5f0fc8
commit
371c610712
5
bin/st
5
bin/st
@ -1020,8 +1020,9 @@ def st_download(options, args, print_queue, error_queue):
|
|||||||
path = options.yes_all and join(container, obj) or obj
|
path = options.yes_all and join(container, obj) or obj
|
||||||
if path[:1] in ('/', '\\'):
|
if path[:1] in ('/', '\\'):
|
||||||
path = path[1:]
|
path = path[1:]
|
||||||
|
make_dir = out_file != "-"
|
||||||
if content_type.split(';', 1)[0] == 'text/directory':
|
if content_type.split(';', 1)[0] == 'text/directory':
|
||||||
if not isdir(path):
|
if make_dir and not isdir(path):
|
||||||
mkdirs(path)
|
mkdirs(path)
|
||||||
read_length = 0
|
read_length = 0
|
||||||
md5sum = md5()
|
md5sum = md5()
|
||||||
@ -1030,7 +1031,7 @@ def st_download(options, args, print_queue, error_queue):
|
|||||||
md5sum.update(chunk)
|
md5sum.update(chunk)
|
||||||
else:
|
else:
|
||||||
dirpath = dirname(path)
|
dirpath = dirname(path)
|
||||||
if dirpath and not isdir(dirpath):
|
if make_dir and dirpath and not isdir(dirpath):
|
||||||
mkdirs(dirpath)
|
mkdirs(dirpath)
|
||||||
if out_file == "-":
|
if out_file == "-":
|
||||||
fp = stdout
|
fp = stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user