File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -46,24 +46,28 @@ New-Item -Type Directory "${GpgHome}" -Force
4646New-Item - Type File " ${GpgHome} \common.conf" - Force
4747
4848# Fetch and verify Cygwin.
49+ Push-Location ${Cygwin}
4950try {
50- if (-Not (Test-Path ${Cygwin} \${Setup} - PathType leaf)) {
51+ if (-Not (Test-Path . \${Setup} - PathType leaf)) {
5152 Invoke-WebRequest ${URL} / ${Setup} `
52- - OutFile ${Cygwin} \${Setup}
53+ - OutFile . \${Setup}
5354 }
54- if (-Not (Test-Path ${Cygwin} \${Setup}.sig - PathType leaf)) {
55+ if (-Not (Test-Path . \${Setup}.sig - PathType leaf)) {
5556 Invoke-WebRequest ${URL} / ${Setup}.sig `
56- - OutFile ${Cygwin} \${Setup}.sig
57+ - OutFile . \${Setup}.sig
5758 }
58- & $GPG -- homedir ${GpgHome} -- list- keys
59- & $GPG -- homedir ${GpgHome} -- quiet -- no- default- keyring `
60- -- keyring ${PSScriptRoot} / cygwin.gpg `
61- -- verify ${Cygwin} \${Setup}.sig ${Cygwin} \${Setup}
59+ Copy-Item " $PSScriptRoot \cygwin.gpg" - Destination " ${Cygwin} "
60+ & $GPG -- homedir ./ .gnupg -- list- keys
61+ & $GPG -- homedir ./ .gnupg -- quiet -- no- default- keyring `
62+ -- keyring ./ cygwin.gpg `
63+ -- verify ./ ${Setup}.sig ./ ${Setup}
6264 if ($LastExitCode -ne 0 ) {
6365 throw " GPG signature verification failed"
6466 }
6567} catch {
6668 throw " Failed to fetch and verify Cygwin"
69+ } finally {
70+ Pop-Location
6771}
6872
6973# Bootstrap Cygwin.
You can’t perform that action at this time.
0 commit comments