File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.`n Run '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.`n Run 'scoop install 7zip' and try again."
213210 }
214- }
215- catch {
211+ } catch {
216212 abort " Unzip failed: $_ "
217213 }
218214}
You can’t perform that action at this time.
0 commit comments