Update for feedback.
This commit is contained in:
parent
2e85f2beb2
commit
f97bce040f
@ -271,7 +271,7 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
def uninstall_login_item(*login_items, command: nil, successor: nil, **_)
|
def uninstall_login_item(*login_items, command: nil, successor: nil, **_)
|
||||||
return unless successor.nil?
|
return if successor
|
||||||
|
|
||||||
apps = cask.artifacts.select { |a| a.class.dsl_key == :app }
|
apps = cask.artifacts.select { |a| a.class.dsl_key == :app }
|
||||||
derived_login_items = apps.map { |a| { path: a.target } }
|
derived_login_items = apps.map { |a| { path: a.target } }
|
||||||
|
|||||||
@ -43,7 +43,7 @@ module Cask
|
|||||||
|
|
||||||
if Utils.path_occupied?(target)
|
if Utils.path_occupied?(target)
|
||||||
if !predecessor.nil? && target.directory? && target.children.empty? && predecessor.artifacts.any? do |a|
|
if !predecessor.nil? && target.directory? && target.children.empty? && predecessor.artifacts.any? do |a|
|
||||||
a.class.dsl_key == self.class.dsl_key && a.target == target
|
a.instance_of?(self.class) && instance_of?(a.class) && a.target == target
|
||||||
end
|
end
|
||||||
# An upgrade removed the directory contents but left the directory itself (see below).
|
# An upgrade removed the directory contents but left the directory itself (see below).
|
||||||
unless source.directory?
|
unless source.directory?
|
||||||
@ -158,7 +158,7 @@ module Cask
|
|||||||
return unless Utils.path_occupied?(target)
|
return unless Utils.path_occupied?(target)
|
||||||
|
|
||||||
if !successor.nil? && target.directory? && successor.artifacts.any? do |a|
|
if !successor.nil? && target.directory? && successor.artifacts.any? do |a|
|
||||||
a.class.dsl_key == self.class.dsl_key && a.target == self.target
|
a.instance_of?(self.class) && instance_of?(a.class) && a.target == self.target
|
||||||
end
|
end
|
||||||
# If an app folder is deleted, macOS considers the app uninstalled and removes some data.
|
# If an app folder is deleted, macOS considers the app uninstalled and removes some data.
|
||||||
# Remove only the contents to handle this case.
|
# Remove only the contents to handle this case.
|
||||||
|
|||||||
@ -179,14 +179,13 @@ module Cask
|
|||||||
def self.copy_xattrs(from, to)
|
def self.copy_xattrs(from, to)
|
||||||
odebug "Copying xattrs from #{from} to #{to}"
|
odebug "Copying xattrs from #{from} to #{to}"
|
||||||
|
|
||||||
copier = system_command!(swift,
|
system_command!(swift,
|
||||||
args: [
|
args: [
|
||||||
*swift_target_args,
|
*swift_target_args,
|
||||||
COPY_XATTRS_SCRIPT,
|
COPY_XATTRS_SCRIPT,
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
])
|
])
|
||||||
copier.success?
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user