fix bug in default command

This commit is contained in:
Ville Rantanen
2021-09-10 17:43:24 +03:00
parent e0c69d7d92
commit 04a6659c1e

13
flit.py
View File

@@ -403,10 +403,15 @@ if __name__ == "__main__":
if opts.command == "list" or opts.command is None:
""" List shares """
if opts.name:
if os.path.isdir(os.path.join(cwd, opts.name)):
opts.name = os.path.basename(os.path.realpath(os.path.join(cwd, opts.name)))
list_folders(opts.root, verbose=opts.verbose, filter_name=opts.name)
name = None
try:
name = opts.name
except AttributeError:
pass
if name:
if os.path.isdir(os.path.join(cwd, name)):
name = os.path.basename(os.path.realpath(os.path.join(cwd, name)))
list_folders(opts.root, verbose=opts.verbose, filter_name=name)
if opts.command == "del":
""" Delete due shares """