diff --git a/README.md b/README.md index b5517a6..accfa8e 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ $ idapm init ~/idapm.json already exists... Do you want to install a plugin written in ~/idapm.json? [Y/n]: y ---------------------- +Try: git clone https://github.com/L4ys/LazyIDA.git Cloning into '/Applications/IDA Pro 7.5/ida.app/Contents/MacOS/plugins/idapm/L4ys/LazyIDA'... Symbolic link(/Applications/IDA Pro 7.5/ida.app/Contents/MacOS/plugins/LazyIDA.py) has been created Installed successfully! @@ -51,6 +52,7 @@ You can install from the specified GitHub repository. ``` $ idapm install L4ys/LazyIDA ---------------------- +Try: git clone https://github.com/L4ys/LazyIDA.git Cloning into '/Applications/IDA Pro 7.5/ida.app/Contents/MacOS/plugins/idapm/L4ys/LazyIDA'... Symbolic link(/Applications/IDA Pro 7.5/ida.app/Contents/MacOS/plugins/LazyIDA.py) has been created. Installed successfully! diff --git a/idapm/cli.py b/idapm/cli.py index d02aafa..6106fdd 100644 --- a/idapm/cli.py +++ b/idapm/cli.py @@ -29,8 +29,8 @@ def cmd_init(args): else: print('~/idapm.json already exists...') + input_pattern = {'y': True, 'yes': True, 'n': False, 'no': False} while True: - input_pattern = {'y': True, 'yes': True, 'n': False, 'no': False} try: key = input('Do you want to install a plugin written in ~/idapm.json? [Y/n]: ').lower() if input_pattern[key]: @@ -38,14 +38,15 @@ def cmd_init(args): for plugin in plugin_repos: print('----------------------') try: - repo_url = 'https://github.com/{0}.git'.format(repo_name) + repo_url = 'https://github.com/{0}.git'.format(plugin) print('Try: git clone {0}'.format(repo_url)) installer.install_from_github(plugin, repo_url) except: - repo_url = 'git@github.com:{0}.git'.format(repo_name) + repo_url = 'git@github.com:{0}.git'.format(plugin) print('Try: git clone {0}'.format(repo_url)) installer.install_from_github(plugin, repo_url) + break except: @@ -60,9 +61,16 @@ def cmd_install(args): if c.check_duplicate(args.plugin_name): print(Fore.RED + '{0} already exists in config'.format(args.plugin_name)) input_pattern = {'y': True, 'yes': True, 'n': False, 'no': False} - key = input('Do you want to reinstall {0}? [Y/n]: '.format(args.plugin_name)).lower() - if not input_pattern[key]: - return + while True: + try: + key = input('Do you want to reinstall {0}? [Y/n]: '.format(args.plugin_name)).lower() + if not input_pattern[key]: + return + else: + break + + except: + pass print('----------------------') repo_https_url = 'https://github.com/{0}.git'.format(args.plugin_name)