Move existence check into helper script
This way, it'll run as `root`, too.
This commit is contained in:
parent
7a22cda8dd
commit
aceb021254
@ -111,6 +111,10 @@ module Cask
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
for path in "${@}"; do
|
for path in "${@}"; do
|
||||||
|
if [[ ! -e "${path}" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -e "${path}/.DS_Store" ]]; then
|
if [[ -e "${path}/.DS_Store" ]]; then
|
||||||
/bin/rm -f "${path}/.DS_Store"
|
/bin/rm -f "${path}/.DS_Store"
|
||||||
fi
|
fi
|
||||||
@ -135,8 +139,6 @@ module Cask
|
|||||||
|
|
||||||
sig { params(path: T.any(Pathname, T::Array[Pathname])).void }
|
sig { params(path: T.any(Pathname, T::Array[Pathname])).void }
|
||||||
def rmdir(path)
|
def rmdir(path)
|
||||||
return unless path.exist?
|
|
||||||
|
|
||||||
@command.run!(
|
@command.run!(
|
||||||
"/usr/bin/xargs",
|
"/usr/bin/xargs",
|
||||||
args: ["-0", "--", "/bin/bash", "-c", RMDIR_SH, "--"],
|
args: ["-0", "--", "/bin/bash", "-c", RMDIR_SH, "--"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user