mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
doubledash hygiene for external cmd: rm
This commit is contained in:
@@ -49,7 +49,7 @@ mark_up_sources () {
|
||||
_list_ids_in_pkg () {
|
||||
|
||||
tmpdir=`/usr/bin/mktemp -d -t list_ids_in_pkg`
|
||||
trap "/bin/rm -rf '$tmpdir'" EXIT
|
||||
trap "/bin/rm -rf -- '$tmpdir'" EXIT
|
||||
|
||||
/usr/sbin/pkgutil --expand "$1" "$tmpdir/unpack"
|
||||
|
||||
|
||||
@@ -63,11 +63,11 @@ not_inside_homebrew () {
|
||||
|
||||
remove_dev_links () {
|
||||
local tap_dir="$1"
|
||||
/bin/rm rubylib Casks
|
||||
/bin/rm -- rubylib Casks
|
||||
/bin/mv -- production_rubylib rubylib
|
||||
/bin/mv -- production_Casks Casks
|
||||
cd "$tap_dir"
|
||||
/bin/rm lib Casks
|
||||
/bin/rm -- lib Casks
|
||||
/bin/mv -- production_lib lib
|
||||
/bin/mv -- production_Casks Casks
|
||||
printf "brew-cask is now in production mode\n"
|
||||
|
||||
@@ -118,7 +118,7 @@ class Cask::Artifact::Pkg < Cask::Artifact::Base
|
||||
if uninstall_options.key? :files
|
||||
uninstall_options[:files].each do |file|
|
||||
ohai "Removing file #{file}"
|
||||
@command.run!('/bin/rm', :args => ['-rf', file], :sudo => true)
|
||||
@command.run!('/bin/rm', :args => ['-rf', '--', file], :sudo => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ class Cask::Pkg
|
||||
def uninstall
|
||||
odebug "Deleting pkg files"
|
||||
list('files').each_slice(500) do |file_slice|
|
||||
@command.run('/bin/rm', :args => file_slice.unshift('-f'), :sudo => true)
|
||||
@command.run('/bin/rm', :args => file_slice.unshift('-f', '--'), :sudo => true)
|
||||
end
|
||||
odebug "Deleting pkg directories"
|
||||
_deepest_path_first(list('dirs')).each do |dir|
|
||||
@@ -80,14 +80,14 @@ class Cask::Pkg
|
||||
def _clean_broken_symlinks(dir)
|
||||
dir.children.each do |child|
|
||||
if _broken_symlink?(child)
|
||||
@command.run!('/bin/rm', :args => [child], :sudo => true)
|
||||
@command.run!('/bin/rm', :args => ['--', child], :sudo => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def _clean_ds_store(dir)
|
||||
ds_store = dir.join('.DS_Store')
|
||||
@command.run!('/bin/rm', :args => [ds_store], :sudo => true) if ds_store.exist?
|
||||
@command.run!('/bin/rm', :args => ['--', ds_store], :sudo => true) if ds_store.exist?
|
||||
end
|
||||
|
||||
def _broken_symlink?(path)
|
||||
|
||||
Reference in New Issue
Block a user