From a4486a16147074dfef28ec09a6c58bd38dfea690 Mon Sep 17 00:00:00 2001 From: Ryan Caloras <rcaloras@alumni.cmu.edu> Date: Mon, 5 Oct 2015 18:32:54 -0400 Subject: [PATCH] Adding better messaging - Should address issue #7 --- bashhub/bashhub_setup.py | 14 ++++++++++---- install-bashhub.sh | 7 ++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/bashhub/bashhub_setup.py b/bashhub/bashhub_setup.py index 2eb3324..30e088b 100755 --- a/bashhub/bashhub_setup.py +++ b/bashhub/bashhub_setup.py @@ -158,8 +158,8 @@ def main(): |____/ \__,_|___/_| |_|_| |_|\__,_|_.__(_)___\___/|_| |_| |_| """ - print ascii_art - print "Welcome to bashhub setup!" + print(ascii_art) + print("Welcome to bashhub setup!") is_new_user = query_yes_no("Are you a new user?") user_id = None if is_new_user: @@ -167,12 +167,18 @@ def main(): user_id = rest_client.register_user(register_user) if user_id != None: print("Registered new user {0}\n".format(register_user.username)) + else: + print("Sorry, registering a new user failed.") else: user_id = get_existing_user_information() + if user_id == None: + print("\nSorry looks like logging in failed.") + print("If you forgot your password please reset it. " + "https://bashhub.com/password-reset") if user_id == None: - print "Sorry looks like getting your info failed.\ - Exiting..." + print("You can rerun setup using 'bashhub setup' in a new " + "terminal window.\n") sys.exit(0) system_id = handle_system_information(user_id) diff --git a/install-bashhub.sh b/install-bashhub.sh index a352a4b..4e83565 100755 --- a/install-bashhub.sh +++ b/install-bashhub.sh @@ -259,7 +259,12 @@ setup_bashhub_files() { cd ~/.bashhub rm client.tar.gz rm -r bashhub-client* - echo "Should be good to go! Please close and restart your terminal session." + + if [ -f ~/.bashhub/.config ]; then + echo "Should be good to go! Please close and restart your terminal session." + else + echo "Please run 'bashhub setup' after restarting your terminal session." + fi } # -- GitLab