Sha256: 7f240266ef0c177424270877aaa6c98bb6c7f875c1ff17259969c44c9946e358
Contents?: true
Size: 1.67 KB
Versions: 3
Compression:
Stored size: 1.67 KB
Contents
require "shelly/cli/main" module Shelly module CLI class Runner < Thor::Shell::Basic include Helpers attr_accessor :args def initialize(args = []) super() @args = args end def debug? args.include?("--debug") || ENV['SHELLY_DEBUG'] == "true" end def start Shelly::CLI::Main.start(args) rescue SystemExit; raise rescue Client::UnauthorizedException raise if debug? say_error "You are not logged in. To log in use: `shelly login`" desc "download [SOURCE_PATH] [DEST_PATH]", "Download files from persitent data storage" rescue Client::NotFoundException => e raise if debug? or e.resource != :cloud say_error "You have no access to '#{e.id}' cloud defined in Cloudfile" rescue Client::GemVersionException => e raise if debug? say "Required shelly gem version: #{e.body["required_version"]}" say "Your version: #{VERSION}" say "Update shelly gem with `gem install shelly`" say_error "or `bundle update shelly` when using bundler" rescue Interrupt raise if debug? say_new_line say_error "[canceled]" rescue Client::APIException => e raise if debug? say_error "You have found a bug in the shelly gem. We're sorry.", :with_exit => e.request_id.blank? say_error <<-eos You can report it to support@shellycloud.com by describing what you wanted to do and mentioning error id #{e.request_id}. eos rescue Exception raise if debug? say_error "Unknown error, to see debug information run command with --debug" end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
shelly-0.1.12 | lib/shelly/cli/runner.rb |
shelly-0.1.11 | lib/shelly/cli/runner.rb |
shelly-0.1.10 | lib/shelly/cli/runner.rb |