require 'claide' require "tty-spinner" module Lhj # command plugin class Command < CLAide::Command require 'lhj/command/init' require 'lhj/command/config' require 'lhj/command/head_import' require 'lhj/command/refactor_rename' require 'lhj/command/local/fetch' require 'lhj/command/local/filter' require 'lhj/command/local/local' require 'lhj/command/local/micro_service' require 'lhj/command/local/local_upload' require 'lhj/command/oss' require 'lhj/command/oss/del' require 'lhj/command/oss/upload' require 'lhj/command/oss/list' require 'lhj/command/view' require 'lhj/command/rename_image' require 'lhj/command/trans' require 'lhj/command/yapi' require 'lhj/command/file_path' require 'lhj/command/http' require 'lhj/command/sync_pod_repo' require 'lhj/command/sync_pod_version' require 'lhj/command/pgyer_upload' require 'lhj/command/duplicate_imageset' self.abstract_command = true self.command = 'lhj' def begin_title '开始处理...' end def auto_spin puts begin_title.green # @spinner.auto_spin end def stop puts '处理完成'.green # @spinner.success('Done!') end def initialize(argv) super(argv) @spinner = TTY::Spinner.new('[:spinner]...', output: $stdout, format: :dots, clear: true) end def run auto_spin handle stop end def handle raise 'A subclass should override the `Lhj::Command#run` method' end end end