aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/artifact/binary.rb
blob: 7178c2af6949561533438f9839c111190a04ab3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "hbc/artifact/symlinked"

module Hbc
  module Artifact
    class Binary < Symlinked
      def link
        super
        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