Skip to content

Commit

Permalink
Use sudo for symlinks if necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed May 13, 2023
1 parent 8ea287c commit c8094b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Library/Homebrew/cask/artifact/symlinked.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def unlink(**)

def create_filesystem_link(command: nil, **_)
target.dirname.mkpath
command.run!("/bin/ln", args: ["-h", "-f", "-s", "--", source, target])
command.run! "/bin/ln", args: ["-h", "-f", "-s", "--", source, target],
sudo: !target.dirname.writable?
add_altname_metadata(source, target.basename, command: command)
end
end
Expand Down

0 comments on commit c8094b1

Please sign in to comment.