2017-09-10 23:12:32 +02:00

18 lines
403 B
Ruby

require "hbc/artifact/symlinked"
module Hbc
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