Skip to content

Commit 70d7390

Browse files
millsksCopilotruben-arts
authored
feat(installer): Add PIXI_DOWNLOAD_URL to use install scripts in private network (#4942)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Ruben Arts <[email protected]>
1 parent b2d58e4 commit 70d7390

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/installation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ its [compile steps](https://github.com/conda/rattler/tree/main#give-it-a-try).
127127
| `PIXI_HOME` | The location of the binary folder. | `$HOME/.pixi` |
128128
| `PIXI_ARCH` | The architecture the Pixi version was built for. | `uname -m` |
129129
| `PIXI_NO_PATH_UPDATE`| If set the `$PATH` will not be updated to add `pixi` to it. | |
130+
| `PIXI_DOWNLOAD_URL` | Overrides the download URL for the Pixi binary (useful for mirrors or custom builds). | GitHub releases, e.g. [linux-64](https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz) |
130131
| `TMP_DIR` | The temporary directory the script uses to download to and unpack the binary from. | `/tmp` |
131132

132133
For example, on Apple Silicon, you can force the installation of the x86 version:
@@ -147,6 +148,7 @@ its [compile steps](https://github.com/conda/rattler/tree/main#give-it-a-try).
147148
| `PIXI_VERSION` | The version of Pixi getting installed, can be used to up- or down-grade. | `latest` |
148149
| `PIXI_HOME` | The location of the installation. | `$Env:USERPROFILE\.pixi` |
149150
| `PIXI_NO_PATH_UPDATE`| If set, the `$PATH` will not be updated to add `pixi` to it. | `false` |
151+
| `PIXI_DOWNLOAD_URL` | Overrides the download URL for the Pixi binary (useful for mirrors or custom builds). | GitHub releases, e.g. [win-64](https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-pc-windows-msvc.zip) |
150152

151153
For example, set the version:
152154
```powershell

install/install.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ if (-not @("x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc") -contains $ARCH)
163163

164164
$BINARY = "pixi-$ARCH"
165165

166-
if ($PixiVersion -eq 'latest') {
166+
if ($Env:PIXI_DOWNLOAD_URL) {
167+
$DOWNLOAD_URL = $Env:PIXI_DOWNLOAD_URL
168+
} elseif ($PixiVersion -eq 'latest') {
167169
$DOWNLOAD_URL = "$PixiRepourl/releases/latest/download/$BINARY.zip"
168170
} else {
169171
# Check if version is incorrectly specified without prefix 'v', and prepend 'v' in this case

install/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ __wrap__() {
3838
fi
3939

4040
if [ "$VERSION" = "latest" ]; then
41-
DOWNLOAD_URL="${REPOURL%/}/releases/latest/download/${BINARY}${EXTENSION-}"
41+
DOWNLOAD_URL="${PIXI_DOWNLOAD_URL:-${REPOURL%/}/releases/latest/download/${BINARY}${EXTENSION-}}"
4242
else
4343
# Check if version is incorrectly specified without prefix 'v', and prepend 'v' in this case
44-
DOWNLOAD_URL="${REPOURL%/}/releases/download/v${VERSION#v}/${BINARY}${EXTENSION-}"
44+
DOWNLOAD_URL="${PIXI_DOWNLOAD_URL:-${REPOURL%/}/releases/download/v${VERSION#v}/${BINARY}${EXTENSION-}}"
4545
fi
4646

4747
printf "This script will automatically download and install Pixi (%s) for you.\nGetting it from this url: %s\n" "$VERSION" "$DOWNLOAD_URL"

0 commit comments

Comments
 (0)