Sha256: b924f51d532adda1b1ce6e41a065982af3abbb82b2788897ddef1d61ad32926c
Contents?: true
Size: 846 Bytes
Versions: 29
Compression:
Stored size: 846 Bytes
Contents
require_relative '../common' module Kontena::Cli::Stacks::Registry class PullCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::Stacks::Common include Kontena::Cli::Stacks::Common::RegistryNameParam banner "Pulls / downloads a stack from the stack registry" option ['-F', '--file'], '[FILENAME]', "Write to file (default STDOUT)" option '--no-cache', :flag, "Don't use local cache" option '--return', :flag, 'Return the result', hidden: true def execute target = no_cache? ? stacks_client : Kontena::StacksCache content = target.pull(stack_name) if return? return content elsif file File.write(file, content) puts pastel.green("Wrote #{content.bytesize} bytes to #{file}") else puts content end end end end
Version data entries
29 entries across 29 versions & 2 rubygems