Class: Nauvisian::CLI::Commands::Mod::Download
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Nauvisian::CLI::Commands::Mod::Download
- Includes:
- DownloadHelper, MessageHelper
- Defined in:
- lib/nauvisian/cli/commands/mod/download.rb
Instance Method Summary collapse
Instance Method Details
#call(mod:, **options) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nauvisian/cli/commands/mod/download.rb', line 20 def call(mod:, **) credential = find_credential(**.slice(:user, :token)) release = find_release(Nauvisian::Mod[name: mod], version: .key?(:version) ? Nauvisian::Version24[[:version]] : nil) downloader = Nauvisian::Downloader.new(credential:, progress: Nauvisian::Progress::Bar) downloader.download(release, release.file_name) rescue => e (e) exit 1 end |