You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
705 B
19 lines
705 B
module Cask::Actions
|
|
def linkapps
|
|
Pathname.glob("#{destination_path}/**/*.app").each do |app|
|
|
destination = Cask.appdir.join(app.basename)
|
|
target = destination_path.join(app)
|
|
if destination.symlink?
|
|
# destination exists but is symlink; removing and relinking
|
|
ohai "[#{self}] linking #{File.basename(destination)}"
|
|
destination.delete
|
|
destination.make_symlink(target)
|
|
elsif destination.directory? || destination.file?
|
|
ohai "[#{self}] NOT linking #{File.basename(destination)} - already exists"
|
|
else
|
|
ohai "[#{self}] linking #{File.basename(destination)}"
|
|
destination.make_symlink(target)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|