Skip to content

Commit df4b213

Browse files
committed
Formatting
1 parent e008f6f commit df4b213

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

lib/core.ps1

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,35 +184,31 @@ function unzip($path, $to) {
184184
if ($retries -eq 10) {
185185
if (7zip_installed) {
186186
extract_7zip $path $to $false
187-
return
188-
}
189-
else {
187+
return
188+
} else {
190189
abort "Unzip failed: Windows can't unzip because a process is locking the file.`nRun 'scoop install 7zip' and try again."
191190
}
192191
}
193192
if (isFileLocked $path) {
194193
write-host "Waiting for $path to be unlocked by another process... ($retries/10)"
195194
$retries++
196195
Start-Sleep -s 2
197-
}
198-
else {
196+
} else {
199197
break
200198
}
201199
}
200+
202201
try {
203202
[io.compression.zipfile]::extracttodirectory($path, $to)
204-
}
205-
catch [system.io.pathtoolongexception] {
203+
} catch [system.io.pathtoolongexception] {
206204
# try to fall back to 7zip if path is too long
207205
if (7zip_installed) {
208206
extract_7zip $path $to $false
209207
return
210-
}
211-
else {
208+
} else {
212209
abort "Unzip failed: Windows can't handle the long paths in this zip file.`nRun 'scoop install 7zip' and try again."
213210
}
214-
}
215-
catch {
211+
} catch {
216212
abort "Unzip failed: $_"
217213
}
218214
}

0 commit comments

Comments
 (0)