Class: Nib::Shell

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/nib/shell.rb

Constant Summary collapse

SCRIPT =
"if hash bash 2>/dev/null ; then\n  bash\nelif hash ash 2>/dev/null ; then\n  ash\nelse\n  sh\nfi\n".freeze

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

#executeObject



14
15
16
17
# File 'lib/nib/shell.rb', line 14

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

#scriptObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/nib/shell.rb', line 19

def script
  @script ||= "    docker-compose \\\n      run \\\n      --rm \\\n      -e HISTFILE=./tmp/shell_history \\\n      \#{service} \\\n      \#{command}\n  SCRIPT\nend\n"