Sha256: 4e5566daadf7b48767447a63b026588462ba8cd5bbae3176deffb7fb263aa26a

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

class Nib::Shell
  include Nib::Command

  SCRIPT = <<~SH.freeze
    if hash bash 2>/dev/null ; then
      bash
    elif hash ash 2>/dev/null ; then
      ash
    else
      sh
    fi
  SH

  def execute
    system('mkdir', '-p', './tmp')
    super
  end

  def script
    @script ||= <<~SCRIPT
      docker-compose \
        run \
        --rm \
        -e HISTFILE=./tmp/shell_history \
        #{service} \
        #{command}
    SCRIPT
  end

  private

  def command
    "/bin/sh -c \"#{SCRIPT}\""
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nib-1.3.0 lib/nib/shell.rb
nib-1.2.2 lib/nib/shell.rb
nib-1.2.1 lib/nib/shell.rb
nib-1.2.0 lib/nib/shell.rb
nib-1.1.0 lib/nib/shell.rb