Method: Stax::Cmd::Lambda#code

Defined in:
lib/stax/mixin/lambda.rb

#code(id) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/stax/mixin/lambda.rb', line 59

def code(id)
  url = Aws::Lambda.code(my.resource(id))
  if options[:url]
    puts url
  else
    Tempfile.new([my.stack_name, '.zip']).tap do |file|
      file.write(open(url).read)
      file.close
      puts %x[unzip -p #{file.path}] # unzip all contents to stdout
    end
  end
end