feat: allow zap on linux
This commit is contained in:
parent
975fe8a83f
commit
27a2d94c48
@ -411,7 +411,7 @@ module Cask
|
|||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
if MacOS.undeletable?(resolved_path)
|
if undeletable?(resolved_path)
|
||||||
opoo "Skipping #{Formatter.identifier(action)} for undeletable path '#{path}'."
|
opoo "Skipping #{Formatter.identifier(action)} for undeletable path '#{path}'."
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@ -538,6 +538,10 @@ module Cask
|
|||||||
recursive_rmdir(*resolved_paths, **kwargs)
|
recursive_rmdir(*resolved_paths, **kwargs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def undeletable?(target); end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require "extend/os/cask/artifact/abstract_uninstall"
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
# typed: strict
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "extend/os/mac/cask/artifact/abstract_uninstall" if OS.mac?
|
||||||
|
require "extend/os/linux/cask/artifact/abstract_uninstall" if OS.linux?
|
@ -0,0 +1,23 @@
|
|||||||
|
# typed: strict
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module OS
|
||||||
|
module Linux
|
||||||
|
module Cask
|
||||||
|
module Artifact
|
||||||
|
module AbstractUninstall
|
||||||
|
extend T::Helpers
|
||||||
|
|
||||||
|
requires_ancestor { ::Cask::Artifact::AbstractUninstall }
|
||||||
|
|
||||||
|
sig { params(target: Pathname).returns(T::Boolean) }
|
||||||
|
def undeletable?(target)
|
||||||
|
!target.parent.writable?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Cask::Artifact::AbstractUninstall.prepend(OS::Linux::Cask::Artifact::AbstractUninstall)
|
@ -0,0 +1,25 @@
|
|||||||
|
# typed: strict
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "cask/macos"
|
||||||
|
|
||||||
|
module OS
|
||||||
|
module Mac
|
||||||
|
module Cask
|
||||||
|
module Artifact
|
||||||
|
module AbstractUninstall
|
||||||
|
extend T::Helpers
|
||||||
|
|
||||||
|
requires_ancestor { ::Cask::Artifact::AbstractUninstall }
|
||||||
|
|
||||||
|
sig { params(target: Pathname).returns(T::Boolean) }
|
||||||
|
def undeletable?(target)
|
||||||
|
MacOS.undeletable?(target)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Cask::Artifact::AbstractUninstall.prepend(OS::Mac::Cask::Artifact::AbstractUninstall)
|
Loading…
x
Reference in New Issue
Block a user