Sha256: 5273301a5ce504f52dd2f9be454eeb474be7aada02e4f60500ccaefcbba2c9c8

Contents?: true

Size: 489 Bytes

Versions: 11

Compression:

Stored size: 489 Bytes

Contents

class Nib::Exec
  include Nib::Command
  prepend Nib::History

  def script
    @script ||= <<-SCRIPT
      docker-compose \
        exec \
        #{options} \
        #{service} \
        #{command}
    SCRIPT
  end

  def action
    @command.to_s.empty? ? '' : "-c '#{@command}'"
  end

  def command
    "
      if hash bash 2>/dev/null ; then
        bash #{action}
      elif hash ash 2>/dev/null ; then
        ash #{action}
      else
        sh #{action}
      fi
    "
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nib-2.1.1 lib/nib/exec.rb
nib-2.1.0 lib/nib/exec.rb
nib-2.0.2 lib/nib/exec.rb
nib-2.0.1 lib/nib/exec.rb
nib-2.0.0 lib/nib/exec.rb
nib-1.7.0 lib/nib/exec.rb
nib-1.6.0 lib/nib/exec.rb
nib-1.5.1 lib/nib/exec.rb
nib-1.5.0 lib/nib/exec.rb
nib-1.4.2 lib/nib/exec.rb
nib-1.4.1 lib/nib/exec.rb