From 7fe2ad49c682a4c827e0fef8665bca26793ce8d9 Mon Sep 17 00:00:00 2001 From: Isa Mert Gurbuz Date: Wed, 20 Jan 2021 22:54:13 +0300 Subject: [PATCH] Fix linking `link_device` should be called before `detect_user_name` because it exits with an error if it can not find a user name --- scli | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scli b/scli index 06ef65d..f917739 100755 --- a/scli +++ b/scli @@ -2861,6 +2861,11 @@ def parse_cfg_file(parser, cli_args): def parse_args(): parser = make_arg_parser() args = parser.parse_args() + + if args.subcommand == 'link': + link_device(args.name) + sys.exit() + if args.config_file: args = parse_cfg_file(parser, args) if args.editor_command is None: @@ -2883,10 +2888,6 @@ def main(): logging.disable() logging.info("scli %s", __version__) - if args.subcommand == 'link': - link_device(args.name) - sys.exit() - if not os.path.exists(SCLI_DATA_FOLDER): try: os.makedirs(SCLI_DATA_FOLDER)