Sha256: a582210877a8ab085d63499c7fb747294d17e9b3a7e227957779f4ae39b358c2
Contents?: true
Size: 1.48 KB
Versions: 3
Compression:
Stored size: 1.48 KB
Contents
#!/usr/bin/env ruby # TODO # => Try to fix spinner bug on Windows (may be a weird interaction with \r) require 'core' options = {} OptionParser.new do |opts| opts.banner = "Usage: #{$PROGRAM_NAME} [options]" opts.separator Paint['\nGeneral Options: ', '#95a5a6'] opts.on('-v', '--verbose', 'Run verbosely') do |v| options[:verbose] = v end # directory flag opts.on('-d DIR', '--dir DIR', String, 'Upload files in DIR') do |d| options[:directory] = d unless d.nil? end opts.on('-h', '--help', 'Show this help message') do puts opts exit end end.parse!(ARGV) if Rise::Util.is_first_run? Rise::Util.setup puts '\nPlease run the `rise` command again to upload your files.' exit 0 end result_url = '' uploader = Rise::Transport::Uploader.new(options[:directory]) unless options[:directory].nil? uploader = Rise::Transport::Uploader.new(Dir.pwd) if options[:directory].nil? puts Paint['Thanks for using Rise! Your local source for serverless deployment!', '#95a5a6'] Whirly.start(spinner: 'dots', status: "Uploading files (#{uploader.total_files} total files)") do beginning_time = Time.now result_url = uploader.upload!(options[:verbose]) # Do the file upload Whirly.status = 'Done!\n' Clipboard.copy(result_url) print Paint["Your url is: #{result_url} (copied to clipboard) ", :bold] puts Paint["[#{((Time.now - beginning_time)).round(2)}s]", "#95a5a6"] puts Paint['Deployment successful!', '#3498db'] end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rise-cli-0.1.5 | bin/rise |
rise-cli-0.1.4 | bin/rise |
rise-cli-0.1.2 | bin/rise |