@@ -21,6 +21,8 @@ task :create_release, %i[gem_version dry_run] do |_t, args|
2121 args_hash = args . to_hash
2222
2323 is_dry_run = Release . object_to_boolean ( args_hash [ :dry_run ] )
24+ puts "is_dry_run: #{ is_dry_run } " if is_dry_run
25+
2426 gem_version = args_hash . fetch ( :gem_version , '' ) . strip
2527 npm_version = gem_version . empty? ? '' : Release . convert_rubygem_to_npm_version ( gem_version )
2628
@@ -39,8 +41,9 @@ task :create_release, %i[gem_version dry_run] do |_t, args|
3941
4042 Release . commit_the_changes unless is_dry_run
4143
44+ Release . bump_gem_version ( gem_version , is_dry_run )
4245 Release . release_the_new_npm_version ( npm_version , is_dry_run )
43- Release . release_the_new_gem_version ( gem_version , is_dry_run )
46+ Release . release_the_new_gem_version ( is_dry_run )
4447
4548 Release . push
4649end
@@ -55,6 +58,10 @@ module Release
5558
5659 # Executes a string or an array of strings in a shell in the given directory in an unbundled environment
5760 def sh_in_dir ( dir , *shell_commands )
61+ puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
62+ puts "sh_in_dir, shell_commands = #{ shell_commands } "
63+ puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
64+
5865 shell_commands . flatten . each { |shell_command | sh %(cd #{ dir } && #{ shell_command . strip } ) }
5966 end
6067
@@ -99,14 +106,17 @@ module Release
99106 raise 'Ensure you have Git and Bundler installed before continuing.'
100107 end
101108
102- def release_the_new_gem_version ( gem_version , is_dry_run )
109+ def bump_gem_version ( gem_version , is_dry_run )
103110 puts 'Bumping gem version'
104111 Release . sh_in_dir (
105112 gem_root ,
106113 "gem bump --no-commit #{ gem_version == '' ? '' : %(--version #{ gem_version } ) } " ,
107114 'bundle install' ,
108- " git commit -am 'Bump version to #{ gem_version } '"
115+ ( is_dry_run ? "" : " git commit -am 'Bump version to #{ gem_version } '")
109116 )
117+ end
118+
119+ def release_the_new_gem_version ( is_dry_run )
110120 puts 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
111121 puts 'Use the OTP for RubyGems!'
112122 puts 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
@@ -115,7 +125,7 @@ module Release
115125 end
116126
117127 def release_the_new_npm_version ( npm_version , is_dry_run )
118- puts ' Making npm release'
128+ puts " Making npm release, #{ is_dry_run ? 'dry run' : 'real run' } "
119129 # Will bump the yarn version, commit, tag the commit, push to repo, and release on yarn
120130 release_it_command = +'release-it'
121131 release_it_command << " #{ npm_version } " unless npm_version == ''
0 commit comments