flajann2 / juwelier

Opinionated tool for creating and managing Rubygem projects using Ruby 2.3 and beyond!
MIT License
91 stars 10 forks source link

Using branch other than `master` for trunk #12

Open anero opened 4 years ago

anero commented 4 years ago

We recently renamed our master branch to main and we're now getting the following error when attempting to do a new release with rake release:

rake aborted!
Git::GitExecuteError: git '--git-dir=/Users/diego/dev/controlshift/upland_mobile_commons_rest/.git' '--work-tree=/Users/diego/dev/controlshift/upland_mobile_commons_rest' '-c' 'color.ui=false' checkout 'master'  2>&1:error: pathspec 'master' did not match any file(s) known to git
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/gems/git-1.7.0/lib/git/lib.rb:989:in `command'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/gems/git-1.7.0/lib/git/lib.rb:666:in `checkout'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/gems/git-1.7.0/lib/git/base.rb:306:in `checkout'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/bundler/gems/juwelier-de59d5a2ddea/lib/juwelier/commands/release_gemspec.rb:27:in `run'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/bundler/gems/juwelier-de59d5a2ddea/lib/juwelier.rb:129:in `release_gemspec'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/bundler/gems/juwelier-de59d5a2ddea/lib/juwelier/tasks.rb:142:in `block (2 levels) in define'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/bin/ruby_executable_hooks:24:in `eval'
/Users/diego/.rvm/gems/ruby-2.6.6@upland_mobile_commons_rest/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => release => gemspec:release
(See full trace by running task with --trace)

Is it possible to customize what branch should be used for generating new releases?

woodhull commented 4 years ago

Its possible to do this using the BRANCH env variable

mikisvaz commented 1 year ago

Is there no way to put this in some configuration file? Setting an environment variable seems error prone.