boneyard-formula-pr: use ohai to print messages
Make its behavior more consistent with that of bump-formula-pr.
This commit is contained in:
parent
11cf7b97c4
commit
0fe532c242
@ -35,18 +35,18 @@ module Homebrew
|
|||||||
boneyard_tap = Tap.fetch("homebrew", "boneyard")
|
boneyard_tap = Tap.fetch("homebrew", "boneyard")
|
||||||
tap_migrations_path = formula.tap.path/"tap_migrations.json"
|
tap_migrations_path = formula.tap.path/"tap_migrations.json"
|
||||||
if ARGV.dry_run?
|
if ARGV.dry_run?
|
||||||
puts "brew update"
|
ohai "brew update"
|
||||||
puts "brew tap #{boneyard_tap.name}"
|
ohai "brew tap #{boneyard_tap.name}"
|
||||||
puts "cd #{formula.tap.path}"
|
ohai "cd #{formula.tap.path}"
|
||||||
cd formula.tap.path
|
cd formula.tap.path
|
||||||
puts "cp #{formula_relpath} #{boneyard_tap.path}"
|
ohai "cp #{formula_relpath} #{boneyard_tap.path}"
|
||||||
puts "git rm #{formula_relpath}"
|
ohai "git rm #{formula_relpath}"
|
||||||
unless File.exist? tap_migrations_path
|
unless File.exist? tap_migrations_path
|
||||||
puts "Creating tap_migrations.json for #{formula.tap.name}"
|
ohai "Creating tap_migrations.json for #{formula.tap.name}"
|
||||||
puts "git add #{tap_migrations_path}"
|
ohai "git add #{tap_migrations_path}"
|
||||||
end
|
end
|
||||||
puts "Loading tap_migrations.json"
|
ohai "Loading tap_migrations.json"
|
||||||
puts "Adding #{formula.name} to tap_migrations.json"
|
ohai "Adding #{formula.name} to tap_migrations.json"
|
||||||
else
|
else
|
||||||
safe_system HOMEBREW_BREW_FILE, "update"
|
safe_system HOMEBREW_BREW_FILE, "update"
|
||||||
safe_system HOMEBREW_BREW_FILE, "tap", boneyard_tap.name
|
safe_system HOMEBREW_BREW_FILE, "tap", boneyard_tap.name
|
||||||
@ -67,7 +67,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
unless which("hub") || local_only
|
unless which("hub") || local_only
|
||||||
if ARGV.dry_run?
|
if ARGV.dry_run?
|
||||||
puts "brew install hub"
|
ohai "brew install hub"
|
||||||
else
|
else
|
||||||
safe_system HOMEBREW_BREW_FILE, "install", "hub"
|
safe_system HOMEBREW_BREW_FILE, "install", "hub"
|
||||||
end
|
end
|
||||||
@ -77,16 +77,16 @@ module Homebrew
|
|||||||
reason = " because #{reason}" if reason
|
reason = " because #{reason}" if reason
|
||||||
|
|
||||||
if ARGV.dry_run?
|
if ARGV.dry_run?
|
||||||
puts "cd #{formula.tap.path}"
|
ohai "cd #{formula.tap.path}"
|
||||||
puts "git checkout --no-track -b #{branch} origin/master"
|
ohai "git checkout --no-track -b #{branch} origin/master"
|
||||||
puts "git commit --no-edit --verbose --message=\"#{formula.name}: migrate to boneyard\" -- #{formula_relpath} #{tap_migrations_path.basename}"
|
ohai "git commit --no-edit --verbose --message=\"#{formula.name}: migrate to boneyard\" -- #{formula_relpath} #{tap_migrations_path.basename}"
|
||||||
|
|
||||||
unless local_only
|
unless local_only
|
||||||
puts "hub fork --no-remote"
|
ohai "hub fork --no-remote"
|
||||||
puts "hub fork"
|
ohai "hub fork"
|
||||||
puts "hub fork (to read $HUB_REMOTE)"
|
ohai "hub fork (to read $HUB_REMOTE)"
|
||||||
puts "git push $HUB_REMOTE #{branch}:#{branch}"
|
ohai "git push $HUB_REMOTE #{branch}:#{branch}"
|
||||||
puts "hub pull-request -m $'#{formula.name}: migrate to boneyard\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
|
ohai "hub pull-request -m $'#{formula.name}: migrate to boneyard\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
cd formula.tap.path
|
cd formula.tap.path
|
||||||
@ -111,22 +111,22 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ARGV.dry_run?
|
if ARGV.dry_run?
|
||||||
puts "cd #{boneyard_tap.path}"
|
ohai "cd #{boneyard_tap.path}"
|
||||||
puts "git checkout --no-track -b #{branch} origin/master"
|
ohai "git checkout --no-track -b #{branch} origin/master"
|
||||||
if bottle_block
|
if bottle_block
|
||||||
puts "Removing bottle block"
|
ohai "Removing bottle block"
|
||||||
else
|
else
|
||||||
puts "No bottle block to remove"
|
ohai "No bottle block to remove"
|
||||||
end
|
end
|
||||||
puts "git add #{formula_file}"
|
ohai "git add #{formula_file}"
|
||||||
puts "git commit --no-edit --verbose --message=\"#{formula.name}: migrate from #{formula.tap.repo}\" -- #{formula_file}"
|
ohai "git commit --no-edit --verbose --message=\"#{formula.name}: migrate from #{formula.tap.repo}\" -- #{formula_file}"
|
||||||
|
|
||||||
unless local_only
|
unless local_only
|
||||||
puts "hub fork --no-remote"
|
ohai "hub fork --no-remote"
|
||||||
puts "hub fork"
|
ohai "hub fork"
|
||||||
puts "hub fork (to read $HUB_REMOTE)"
|
ohai "hub fork (to read $HUB_REMOTE)"
|
||||||
puts "git push $HUB_REMOTE #{branch}:#{branch}"
|
ohai "git push $HUB_REMOTE #{branch}:#{branch}"
|
||||||
puts "hub pull-request --browse -m $'#{formula.name}: migrate from #{formula.tap.repo}\\n\\nGoes together with $PR_URL\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
|
ohai "hub pull-request --browse -m $'#{formula.name}: migrate from #{formula.tap.repo}\\n\\nGoes together with $PR_URL\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
cd boneyard_tap.formula_dir
|
cd boneyard_tap.formula_dir
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user