File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## [ Unreleased] ( https://github.com/ScoopInstaller/Scoop/compare/master...develop )
2+
3+ ### Bug Fixes
4+
5+ - ** bucket:** Don't check remote URL of non-git buckets ([ #4923 ] ( https://github.com/ScoopInstaller/Scoop/issues/4923 ) )
6+
17## [ v0.2.0] ( https://github.com/ScoopInstaller/Scoop/compare/v0.1.0...v0.2.0 ) - 2022-05-10
28
39### Features
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ function Convert-RepositoryUri {
109109 [CmdletBinding ()]
110110 param (
111111 [Parameter (Mandatory , Position = 0 , ValueFromPipeline = $true )]
112+ [AllowEmptyString ()]
112113 [String ] $Uri
113114 )
114115
@@ -161,10 +162,12 @@ function add_bucket($name, $repo) {
161162 return 1
162163 }
163164 foreach ($bucket in Get-LocalBucket ) {
164- $remote = git - C " $bucketsdir \$bucket " config -- get remote.origin.url
165- if ((Convert-RepositoryUri - Uri $remote ) -eq $uni_repo ) {
166- warn " Bucket $bucket already exists for $repo "
167- return 2
165+ if (Test-Path - Path " $bucketsdir \$bucket \.git" ) {
166+ $remote = git - C " $bucketsdir \$bucket " config -- get remote.origin.url
167+ if ((Convert-RepositoryUri - Uri $remote ) -eq $uni_repo ) {
168+ warn " Bucket $bucket already exists for $repo "
169+ return 2
170+ }
168171 }
169172 }
170173
Original file line number Diff line number Diff line change @@ -133,9 +133,15 @@ function update_scoop() {
133133 if (! (Test-Path (Join-Path $bucketLoc ' .git' ))) {
134134 if ($bucket -eq ' main' ) {
135135 # Make sure main bucket, which was downloaded as zip, will be properly "converted" into git
136- Write-Host " Converting 'main' bucket to git..."
137- rm_bucket ' main'
138- add_bucket ' main'
136+ Write-Host " Converting 'main' bucket to git repo..."
137+ $status = rm_bucket ' main'
138+ if ($status -ne 0 ) {
139+ abort " Failed to remove local 'main' bucket."
140+ }
141+ $status = add_bucket ' main' (known_bucket_repo ' main' )
142+ if ($status -ne 0 ) {
143+ abort " Failed to add remote 'main' bucket."
144+ }
139145 } else {
140146 Write-Host " '$bucket ' is not a git repository. Skipped."
141147 }
You can’t perform that action at this time.
0 commit comments