lib/learn_submit/submission/git_interactor.rb in learn-submit-1.1.2 vs lib/learn_submit/submission/git_interactor.rb in learn-submit-1.1.3

- old
+ new

@@ -40,24 +40,24 @@ rescue ArgumentError => e if e.message.match(/path does not exist/) puts "It doesn't look like you're in a lesson directory." puts 'Please cd into an appropriate directory and try again.' - exit + exit 1 else puts 'Sorry, something went wrong. Please try again.' - exit + exit 1 end end end def check_remote if git.remote.url.match(/#{username}/).nil? && git.remote.url.match(/#{LEARN_ORG_NAMES.join('|').gsub('-','\-')}/).nil? puts "It doesn't look like you're in a lesson directory." puts 'Please cd into an appropriate directory and try again.' - exit + exit 1 else self.remote_name = if git.remote.url.match(/#{username}/).nil? fix_remote! else git.remote.name @@ -78,11 +78,11 @@ begin git.add_remote("#{old_remote_name}-bak", old_url) rescue Git::GitExecuteError => e if e.message.match(/already exists/).nil? puts "Sorry, something Git-related went wrong. Please try again." - exit + exit 1 end end end def remove_old_remote @@ -108,11 +108,11 @@ rescue Git::GitExecuteError => e if e.message.match(/nothing to commit/) puts "It looks like you have no changes to commit. Will still try updating your submission..." else puts 'Sorry, something went wrong. Please try again.' - exit + exit 1 end end end def push!(retries=3) @@ -126,10 +126,10 @@ if retries > 0 puts "Seems there was an error pushing to GitHub. Trying again..." puts!(retries-1) else puts "Can't reach GitHub right now. Please try again." - exit + exit 1 end end end end end