Skip to content

Conversation

@hollabaq86
Copy link

@hollabaq86 hollabaq86 commented Jan 30, 2021

👋 When trying to use the gem for a public GitHub repo, I encountered the following error:

Traceback (most recent call last):
	9: from /usr/local/bin/master_to_main:23:in `<main>'
	8: from /usr/local/bin/master_to_main:23:in `load'
	7: from /Library/Ruby/Gems/2.6.0/gems/master_to_main-0.0.7/exe/master_to_main:5:in `<top (required)>'
	6: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
	5: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	4: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	3: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	2: from /Library/Ruby/Gems/2.6.0/gems/master_to_main-0.0.7/lib/master_to_main/cli.rb:14:in `update'
	1: from /Library/Ruby/Gems/2.6.0/gems/master_to_main-0.0.7/lib/master_to_main/cli.rb:89:in `prompt_info'
/Library/Ruby/Gems/2.6.0/gems/master_to_main-0.0.7/lib/master_to_main/cli.rb:72:in `get_github_info': undefined method `split' for nil:NilClass (NoMethodError)

On investigation, current behavior is expecting a : in the URL of the repo being updated, which isn't the case for public-facing repos (i.e. github.com/dewyze/master_to_main).

This PR:

  • fixes up this issue with a match statement (I though a specific check for com: would be enough to differentiate between GHE URLs and public domains)
  • Clarifies the documentation a bit (I got a little confused updating repos that are owned by an organization and not me)
  • Updates the CHANGELOG and CONTRIBUTORs files.

Thanks for making this gem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant