Skip to content

Commit d63f3f6

Browse files
committed
feat: Allow specifying a specific version in install script
1 parent 1a06faf commit d63f3f6

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

website/public/install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Write-Host -ForegroundColor Red " `$`$/
2222
Write-Host ""
2323

2424
$package = "superfile"
25-
$version = "1.3.0"
25+
$version = if ($env:SPF_INSTALL_VERSION) { $env:SPF_INSTALL_VERSION } else { "1.3.0" }
2626

2727
$installInstructions = @'
2828
This installer is only available for Windows.
@@ -111,7 +111,7 @@ if (-not (Test-Path $superfileProgramPath)) {
111111
}
112112
}
113113

114-
Write-Host "Downloading superfile..."
114+
Write-Host "Downloading superfile...(Version v$version)"
115115

116116
$url = "https://github.com/yorukot/superfile/releases/download/v$version/$filename"
117117
try {

website/public/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if [ $? -ne 0 ]; then
3939
fi
4040

4141
package=superfile
42-
version=1.3.0
42+
version=${SPF_INSTALL_VERSION:-1.3.0}
4343
arch=$(uname -m)
4444
os=$(uname -s)
4545

website/public/uninstall.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Write-Host -ForegroundColor Red " `$`$/
2222
Write-Host ""
2323

2424
$package = "superfile"
25-
$version = "1.3.0"
2625

2726
$installInstructions = @'
2827
This uninstaller is only available for Windows.

website/src/content/docs/getting-started/installation.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,32 @@ Or with `wget`:
3333
bash -c "$(wget -qO- https://superfile.netlify.app/install.sh)"
3434
```
3535

36+
Use `SPF_INSTALL_VERSION` to specify a version :
37+
38+
```bash
39+
SPF_INSTALL_VERSION=1.2.1 bash -c "$(curl -sLo- https://superfile.netlify.app/install.sh)"
40+
```
41+
3642
### Windows
3743

3844
With `powershell`:
3945

4046
```bash
4147
powershell -ExecutionPolicy Bypass -Command "Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://superfile.netlify.app/install.ps1'))"
4248
```
49+
4350
:::note
4451
To uninstall, run the above `powershell` command with the modified URL:
4552

4653
`https://superfile.netlify.app/uninstall.ps1`
4754
:::
4855

56+
Use `SPF_INSTALL_VERSION` to specify a version :
57+
58+
```bash
59+
powershell -ExecutionPolicy Bypass -Command "$env:SPF_INSTALL_VERSION=1.2.1; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://superfile.netlify.app/install.ps1'))"
60+
```
61+
4962
With [Scoop](https://scoop.sh/):
5063

5164
```bash

0 commit comments

Comments
 (0)