cask: don't assume that sudo has write access to the caskroom
This commit is contained in:
parent
3e257890da
commit
618700a95c
@ -79,7 +79,10 @@ module Cask
|
||||
if target.dirname.writable?
|
||||
FileUtils.move(source, target)
|
||||
else
|
||||
command.run!("/bin/mv", args: [source, target], sudo: true)
|
||||
# default sudo user isn't necessarily able to write to Homebrew's locations
|
||||
# e.g. with runas_default set in the sudoers (5) file.
|
||||
command.run!("/bin/cp", args: ["-pR", source, target], sudo: true)
|
||||
source.rmtree
|
||||
end
|
||||
|
||||
post_move(command)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user