Skip to content

Commit

Permalink
fix(bucket): Implement error handling for failed bucket addition (#6051)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Jul 8, 2024
1 parent 83f25a4 commit 7cc4fae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- **sqlite:** Fix compatibility with Windows PowerShell ([#6045](https://github.com/ScoopInstaller/Scoop/issues/6045))
- **install:** Expand `env_set` items before setting Environment Variables ([#6050](https://github.com/ScoopInstaller/Scoop/issues/6050))
- **bucket:** Implement error handling for failed bucket addition ([#6051](https://github.com/ScoopInstaller/Scoop/issues/6051))

## [v0.5.0](https://github.com/ScoopInstaller/Scoop/compare/v0.4.2...v0.5.0) - 2024-07-01

Expand Down
7 changes: 6 additions & 1 deletion lib/buckets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ function add_bucket($name, $repo) {
}
ensure $bucketsdir | Out-Null
$dir = ensure $dir
Invoke-Git -ArgumentList @('clone', $repo, $dir, '-q')
$out = Invoke-Git -ArgumentList @('clone', $repo, $dir, '-q')
if ($LASTEXITCODE -ne 0) {
error "Failed to clone '$repo' to '$dir'.`n`nError given:`n$out`n`nPlease check the repository URL or network connection and try again."
Remove-Item $dir -Recurse -Force -ErrorAction SilentlyContinue
return 1
}
Write-Host 'OK'
if (get_config USE_SQLITE_CACHE) {
info 'Updating cache...'
Expand Down

0 comments on commit 7cc4fae

Please sign in to comment.