mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
19 lines
406 B
Ruby
19 lines
406 B
Ruby
require "cask/artifact/symlinked"
|
|
|
|
module Cask
|
|
module Artifact
|
|
class Binary < Symlinked
|
|
def link(command: nil, **options)
|
|
super(command: command, **options)
|
|
return if source.executable?
|
|
|
|
if source.writable?
|
|
FileUtils.chmod "+x", source
|
|
else
|
|
command.run!("/bin/chmod", args: ["+x", source], sudo: true)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|