ruff-installer.ps1
Calls a provider property setter cmdletBinds Reflection.Assembly to a variable
SHA-256d6603da2e989dc15d3c9bc3c255d6a95db63cc778c9ef6d17cb41d571b9f153c
MaleculeK(Am)H₆(Cm₈Db₆F₅Os₆Po₂)
Evidence
1# Licensed under the MIT license
2# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
3# option. This file may not be copied, modified, or distributed
4# except according to those terms.
5
6<#
7.SYNOPSIS
8
9The installer for ruff 0.17.5
10
11.DESCRIPTION
12
13This script detects what platform you're on and fetches an appropriate archive from
14https://releases.astral.sh/github/ruff/releases/download/0.17.5
15then unpacks the binaries and installs them to the first of the following locations
16
17 $env:XDG_BIN_HOME
18 $env:XDG_DATA_HOME/../bin
19 $HOME/.local/bin
20
21It will then add that dir to PATH by editing your Environment.Path registry key
22
23.PARAMETER NoModifyPath
24Don't add th …
49:66… eleases/download/0.17.5")
50} else {
51 $ArtifactDownloadUrls = @("https://releases.astral.sh/github/ruff/releases/download/0.17.5", "https://github.com/astral-sh/ruff/releases/download/0.17.5")
52}
53
⋯4 lines
86:6… ion Install-Binary($install_args) {
87 if ($Help) {
88 Get-Help $PSCommandPath -Detailed
89 Exit
90 }
⋯6 lines
153:3… }
154 "aliases_json" = '{}'
155 }
156 }
157
158 $arch = Get-TargetTriple $platforms
159 if (-not $platforms.ContainsKey($arch)) {
160 $platforms_json = ConvertTo-Json $platforms
161 throw "ERROR: could not find binaries for this platform. Last platform tried: $arch platform info: $platforms_json"
162 }
163 Write-Information "downloading $app_name $app_version ($arch)"
164
165 $download_result = $false
166 $first_url = $true
167 foreach ($url in $ArtifactDownloadUrls) {
168 if (-not $first_url) {
169 Write-Information "trying alternative …
211:90… 22H2.
212 # Ideally this would just be
213 # [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
214 # but that gets a type from the wrong assembly on Windows PowerShell (i.e. not Core)
215 $a = [System.Reflection.Assembly]::LoadWithPartialName("System.Runtime.InteropServices.RuntimeInformation")
216 $t = $a.GetType("System.Runtime.InteropServices.RuntimeInformation")
217 …