Skip to content
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

feat(message): Add config to disable aria2 warning message #4422

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ Scoop can utilize [`aria2`](https://github.com/aria2/aria2) to use multi-connect
scoop install aria2
```

By default, `scoop` displays a warning when running `scoop install` or `scoop update` while `aria2` is enabled. This warning can be suppressed by running `scoop config aria2-warning-enabled false`.

You can tweak the following `aria2` settings with the `scoop config` command:

- aria2-enabled (default: true)
- aria2-warning-enabled (default: true)
- [aria2-retry-wait](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-retry-wait) (default: 2)
- [aria2-split](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-s) (default: 5)
- [aria2-max-connection-per-server](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-x) (default: 5)
Expand Down
3 changes: 2 additions & 1 deletion libexec/scoop-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ $skip | Where-Object { $explicit_apps -contains $_ } | ForEach-Object {
}

$suggested = @{ };
if (Test-Aria2Enabled) {
if ((Test-Aria2Enabled) -and (get_config 'aria2-warning-enabled' $true)) {
warn "Scoop uses 'aria2c' for multi-connection downloads."
warn "Should it cause issues, run 'scoop config aria2-enabled false' to disable it."
warn "To disable this warning, run 'scoop config aria2-warning-enabled false'."
}
$apps | ForEach-Object { install_app $_ $architecture $global $suggested $use_cache $check_hash }

Expand Down
3 changes: 2 additions & 1 deletion libexec/scoop-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,10 @@ if (!$apps) {
}
}

if ($outdated -and (Test-Aria2Enabled)) {
if ($outdated -and ((Test-Aria2Enabled) -and (get_config 'aria2-warning-enabled' $true))) {
warn "Scoop uses 'aria2c' for multi-connection downloads."
warn "Should it cause issues, run 'scoop config aria2-enabled false' to disable it."
warn "To disable this warning, run 'scoop config aria2-warning-enabled false'."
}
if ($outdated.Length -gt 1) {
write-host -f DarkCyan "Updating $($outdated.Length) outdated apps:"
Expand Down