From 04a6659c1e641f3fac61bf5c0d681178a72549cf Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 10 Sep 2021 17:43:24 +0300 Subject: [PATCH] fix bug in default command --- flit.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/flit.py b/flit.py index d18af4c..f3fabd5 100755 --- a/flit.py +++ b/flit.py @@ -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 """