Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/commands/build/distribution/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Install < EmergeCLI::Commands::GlobalOptions

option :api_token, type: :string, required: false,
desc: 'API token for authentication, defaults to ENV[EMERGE_API_TOKEN]'
option :build_id, type: :string, required: true, desc: 'Build ID to download'
option :id, type: :string, required: true, desc: 'Emerge build ID to download'
option :install, type: :boolean, default: true, required: false, desc: 'Install the build on the device'
option :device_id, type: :string, desc: 'Specific device ID to target'
option :device_type, type: :string, enum: %w[virtual physical any], default: 'any',
Expand All @@ -33,7 +33,7 @@ def call(**options)
api_token = @options[:api_token] || ENV.fetch('EMERGE_API_TOKEN', nil)
raise 'API token is required' unless api_token

raise 'Build ID is required' unless @options[:build_id]
raise 'Build ID is required' unless @options[:id]

output_name = nil
app_id = nil
Expand All @@ -42,15 +42,15 @@ def call(**options)
@network ||= EmergeCLI::Network.new(api_token:)

Logger.info 'Getting build URL...'
request = get_build_url(@options[:build_id])
request = get_build_url(@options[:id])
response = parse_response(request)

platform = response['platform']
download_url = response['downloadUrl']
app_id = response['appId']

extension = platform == 'ios' ? 'ipa' : 'apk'
output_name = @options[:output] || "#{@options[:build_id]}.#{extension}"
output_name = @options[:output] || "#{@options[:id]}.#{extension}"

if File.exist?(output_name)
Logger.info "Build file already exists at #{output_name}"
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/reaper/reaper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Commands
class Reaper < EmergeCLI::Commands::GlobalOptions
desc 'Analyze dead code from an Emerge upload'

option :upload_id, type: :string, required: true, desc: 'Upload ID to analyze'
option :id, type: :string, required: true, desc: 'Upload ID to analyze'
option :project_root, type: :string, required: true,
desc: 'Root directory of the project, defaults to current directory'

Expand Down Expand Up @@ -38,7 +38,7 @@ def call(**options)
project_root = @options[:project_root] || Dir.pwd

Sync do
all_data = @profiler.measure('fetch_dead_code') { fetch_all_dead_code(@options[:upload_id]) }
all_data = @profiler.measure('fetch_dead_code') { fetch_all_dead_code(@options[:id]) }
result = @profiler.measure('parse_dead_code') { DeadCodeResult.new(all_data) }

Logger.info result.to_s
Expand Down