mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-29 00:06:29 +00:00
[install.ps1] Change permission of the downloaded binary (#2308)
Fix #2256
This commit is contained in:
parent
32c493e994
commit
3afa920151
@ -43,7 +43,11 @@ function download {
|
|||||||
$url="https://github.com/junegunn/fzf/releases/download/$version/$file"
|
$url="https://github.com/junegunn/fzf/releases/download/$version/$file"
|
||||||
$temp=$env:TMP + "\fzf.zip"
|
$temp=$env:TMP + "\fzf.zip"
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
(New-Object Net.WebClient).DownloadFile($url, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$temp"))
|
if ($PSVersionTable.PSVersion.Major -ge 3) {
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile $temp
|
||||||
|
} else {
|
||||||
|
(New-Object Net.WebClient).DownloadFile($url, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$temp"))
|
||||||
|
}
|
||||||
if ($?) {
|
if ($?) {
|
||||||
(Microsoft.PowerShell.Archive\Expand-Archive -Path $temp -DestinationPath .); (Remove-Item $temp)
|
(Microsoft.PowerShell.Archive\Expand-Archive -Path $temp -DestinationPath .); (Remove-Item $temp)
|
||||||
} else {
|
} else {
|
||||||
@ -53,7 +57,7 @@ function download {
|
|||||||
$binary_error="Failed to download $file"
|
$binary_error="Failed to download $file"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
check_binary >$null
|
echo y | icacls $fzf_base\bin\fzf.exe /grant Administrator:F ; check_binary >$null
|
||||||
}
|
}
|
||||||
|
|
||||||
download "fzf-$version-windows_amd64.zip"
|
download "fzf-$version-windows_amd64.zip"
|
||||||
|
Loading…
Reference in New Issue
Block a user