-
Notifications
You must be signed in to change notification settings - Fork 249
fixing the cli option retry_download_count to support simulator #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 9 commits
6c56bc6
3043349
0f96458
4346244
a44cd49
0416bc1
094549d
1e19ac4
323dff9
fdc2749
c14e5d2
6390847
d77e6b8
65d6900
5c39dc5
604d308
0909d80
dbacf6e
3c92030
e27710a
3062bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ def self.options | |
| ['--no-progress', 'Don’t show download progress.'], | ||
| ['--no-clean', 'Don’t delete DMG after installation.'], | ||
| ['--no-show-release-notes', 'Don’t open release notes in browser after installation.'], | ||
| ['--retry-download-count', 'Count of retrying download when curl is failed.']].concat(super) | ||
| ['--number-of-try', 'How many times try to download DMG file if downloading fails. Default is 3.']].concat(super) | ||
|
||
| end | ||
|
|
||
| def initialize(argv) | ||
|
|
@@ -32,7 +32,7 @@ def initialize(argv) | |
| @should_switch = argv.flag?('switch', true) | ||
| @progress = argv.flag?('progress', true) | ||
| @show_release_notes = argv.flag?('show-release-notes', true) | ||
| @retry_download_count = argv.option('retry-download-count', '3') | ||
| @number_of_try = argv.option('number-of-try', '3') | ||
gunesmes marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| super | ||
| end | ||
|
|
||
|
|
@@ -46,12 +46,12 @@ def validate! | |
| end | ||
| fail Informative, "Version #{@version} doesn't exist." unless @url || @installer.exist?(@version) | ||
| fail Informative, "Invalid URL: `#{@url}`" unless !@url || @url =~ /\A#{URI.regexp}\z/ | ||
| fail Informative, "Invalid Retry: `#{@retry_download_count} is not positive number.`" if (@retry_download_count =~ /\A[0-9]*\z/).nil? | ||
| fail Informative, "Invalid Retry: `#{@number_of_try} is not positive number.`" if (@number_of_try =~ /\A[0-9]*\z/).nil? | ||
| end | ||
|
|
||
| def run | ||
| @installer.install_version(@version, @should_switch, @should_clean, @should_install, | ||
| @progress, @url, @show_release_notes, nil, @retry_download_count.to_i) | ||
| @progress, @url, @show_release_notes, nil, @number_of_try.to_i) | ||
| end | ||
| end | ||
| end | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.