Sha256: 9c5d5ba7e0273a4af55fc43966a6bf12f246ce6fee7dfc08db094b840e102169

Contents?: true

Size: 378 Bytes

Versions: 1

Compression:

Stored size: 378 Bytes

Contents

class Stencil
  class Cmd
    class <<self
      
      def run(path, cmd=nil)
        if cmd.nil?
          cmd, path = path, cmd
        else
          path = "cd #{path} && "
        end
        
        output = `#{[ path, cmd ].compact.join} 2>&1`

        unless $?.success?
          Msg.error "#{cmd}\n\n#{output}"
        end

        output
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stencil-0.1.8 lib/stencil/cmd.rb