doubledash hygiene for external cmd: rm

This commit is contained in:
Roland Walker
2014-01-31 13:05:09 -05:00
parent e5a16f90e9
commit a7f1bc6693
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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"
+2 -2
View File
@@ -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"
+1 -1
View File
@@ -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
View File
@@ -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)