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/oss/info' require 'lhj/command/oss/list_bucket' require 'lhj/command/oss/update_bucket' require 'lhj/command/oss/download' require 'lhj/command/code/view' require 'lhj/command/code/code_template' require 'lhj/command/rename_image' require 'lhj/command/trans' require 'lhj/command/yapi/yapi_init' 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/sync_pod_code' require 'lhj/command/pgyer_upload' require 'lhj/command/duplicate_imageset' require 'lhj/command/jenkins_build' self.abstract_command = true self.command = 'lhj' self.version = VERSION 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