Sha256: bb8222e495b8a0182293696b244242ff6ee2c9e43812814f00cca70c9ca1de12
Contents?: true
Size: 877 Bytes
Versions: 24
Compression:
Stored size: 877 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.stack_name, stack_name.version) 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
24 entries across 24 versions & 1 rubygems