Fix tap unavailable error for migrated Cask taps.
This commit is contained in:
parent
ae52b457d0
commit
0cb960951f
@ -13,11 +13,13 @@ class Tap
|
|||||||
|
|
||||||
old_name = name
|
old_name = name
|
||||||
old_path = path
|
old_path = path
|
||||||
old_remote = remote
|
old_remote = path.git_origin
|
||||||
|
|
||||||
clear_cache
|
clear_cache
|
||||||
super(new_user, new_repo)
|
super(new_user, new_repo)
|
||||||
|
|
||||||
|
return unless old_path.directory?
|
||||||
|
|
||||||
new_initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{repo_var}"
|
new_initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{repo_var}"
|
||||||
new_current_revision_var = "HOMEBREW_UPDATE_AFTER#{repo_var}"
|
new_current_revision_var = "HOMEBREW_UPDATE_AFTER#{repo_var}"
|
||||||
|
|
||||||
@ -30,14 +32,14 @@ class Tap
|
|||||||
|
|
||||||
ohai "Migrating tap #{old_name} to #{new_name}..." if $stdout.tty?
|
ohai "Migrating tap #{old_name} to #{new_name}..." if $stdout.tty?
|
||||||
|
|
||||||
|
if old_path.git?
|
||||||
|
puts "Changing remote from #{old_remote} to #{new_remote}..." if $stdout.tty?
|
||||||
|
old_path.git_origin = new_remote
|
||||||
|
end
|
||||||
|
|
||||||
puts "Moving #{old_path} to #{new_path}..." if $stdout.tty?
|
puts "Moving #{old_path} to #{new_path}..." if $stdout.tty?
|
||||||
path.dirname.mkpath
|
path.dirname.mkpath
|
||||||
FileUtils.mv old_path, new_path
|
FileUtils.mv old_path, new_path
|
||||||
|
|
||||||
return unless old_path.git?
|
|
||||||
|
|
||||||
puts "Changing remote from #{old_remote} to #{new_remote}..." if $stdout.tty?
|
|
||||||
new_path.git_origin = new_remote
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user