Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,47 +98,36 @@ The artifacts are uploaded both as workflow artifacts and automatically added to

For reproducible installs, prefer a release tag (or commit SHA) instead of the mutable `main` branch.
Replace every `<version>` placeholder below with the same release tag, including the `v` prefix (for example `v1.3.0`).
The examples download the script first so you can review it before executing.
The commands below stream the script directly into the shell / PowerShell, so no temporary script download is required.
You can additionally set `SORT_IT_NOW_VERSION=<version>` to instruct the install scripts to download that specific release.

- Linux / macOS install:

```bash
curl -fsSLo /tmp/sort-it-now-install-unix.sh \
https://raw.githubusercontent.com/JosunLP/sort-it-now/<version>/scripts/install-unix.sh
chmod +x /tmp/sort-it-now-install-unix.sh
SORT_IT_NOW_VERSION=<version> /tmp/sort-it-now-install-unix.sh
curl -fsSL https://raw.githubusercontent.com/JosunLP/sort-it-now/<version>/scripts/install-unix.sh | SORT_IT_NOW_VERSION=<version> bash
```
Comment thread
JosunLP marked this conversation as resolved.

- Linux / macOS uninstall:

```bash
curl -fsSLo /tmp/sort-it-now-uninstall-unix.sh \
https://raw.githubusercontent.com/JosunLP/sort-it-now/<version>/scripts/uninstall-unix.sh
chmod +x /tmp/sort-it-now-uninstall-unix.sh
/tmp/sort-it-now-uninstall-unix.sh
curl -fsSL https://raw.githubusercontent.com/JosunLP/sort-it-now/<version>/scripts/uninstall-unix.sh | bash
```
Comment thread
JosunLP marked this conversation as resolved.

- Windows install (PowerShell):
- Windows install (PowerShell, run as Administrator for the default destination under `%ProgramFiles%`):

```powershell
$version = "<version>"
$script = Join-Path $env:TEMP "sort-it-now-install-windows.ps1"
irm "https://raw.githubusercontent.com/JosunLP/sort-it-now/$version/scripts/install-windows.ps1" -OutFile $script
$env:SORT_IT_NOW_VERSION = $version
& $script
$env:SORT_IT_NOW_VERSION="<version>"; irm "https://raw.githubusercontent.com/JosunLP/sort-it-now/<version>/scripts/install-windows.ps1" | iex
```

- Windows uninstall (PowerShell):

```powershell
$version = "<version>"
$script = Join-Path $env:TEMP "sort-it-now-uninstall-windows.ps1"
irm "https://raw.githubusercontent.com/JosunLP/sort-it-now/$version/scripts/uninstall-windows.ps1" -OutFile $script
& $script
irm "https://raw.githubusercontent.com/JosunLP/sort-it-now/<version>/scripts/uninstall-windows.ps1" | iex
```

Both installer scripts also continue to work locally from an extracted release bundle. Set `INSTALL_DIR` (Unix) or `-Destination` (PowerShell) to override the default target.
If you prefer to review the script before execution, you can still download it manually first.

Both installer scripts also continue to work locally from an extracted release bundle. Set `INSTALL_DIR` (Unix) or `-Destination` (PowerShell, for example `"$env:LOCALAPPDATA\Programs\sort-it-now"` for a per-user install) to override the default target.

### Archive Installation Scripts

Expand Down
12 changes: 8 additions & 4 deletions scripts/install-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ OWNER="${SORT_IT_NOW_GITHUB_OWNER:-JosunLP}"
REPO="${SORT_IT_NOW_GITHUB_REPO:-sort-it-now}"
REQUESTED_VERSION="${SORT_IT_NOW_VERSION:-latest}"
SCRIPT_SOURCE="${BASH_SOURCE[0]:-}"
SCRIPT_DIR="$PWD"
SCRIPT_DIR=""
DOWNLOAD_TMP_DIR=""

if [[ -n "$SCRIPT_SOURCE" && -e "$SCRIPT_SOURCE" ]]; then
if [[ -n "$SCRIPT_SOURCE" && -f "$SCRIPT_SOURCE" ]]; then
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_SOURCE")" && pwd)"
fi

Expand Down Expand Up @@ -155,8 +155,12 @@ download_and_install_latest_release() {
INSTALL_DIR="$INSTALL_DIR" bash "$bundle_dir/install.sh"
}

BINARY_PATH="$SCRIPT_DIR/$APP_NAME"
if [[ -f "$BINARY_PATH" ]]; then
BINARY_PATH=""
if [[ -n "$SCRIPT_DIR" ]]; then
BINARY_PATH="$SCRIPT_DIR/$APP_NAME"
fi

if [[ -n "$BINARY_PATH" && -f "$BINARY_PATH" ]]; then
install_local_binary "$BINARY_PATH"
else
download_and_install_latest_release
Expand Down
7 changes: 4 additions & 3 deletions scripts/install-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ $ErrorActionPreference = "Stop"
$Owner = if ($env:SORT_IT_NOW_GITHUB_OWNER) { $env:SORT_IT_NOW_GITHUB_OWNER } else { "JosunLP" }
$Repo = if ($env:SORT_IT_NOW_GITHUB_REPO) { $env:SORT_IT_NOW_GITHUB_REPO } else { "sort-it-now" }
$RequestedVersion = if ($env:SORT_IT_NOW_VERSION) { $env:SORT_IT_NOW_VERSION } else { "latest" }
$scriptDir = if ($MyInvocation.MyCommand.Path) { Split-Path -Parent $MyInvocation.MyCommand.Path } else { (Get-Location).Path }
$binaryPath = Join-Path $scriptDir "sort_it_now.exe"
$scriptPath = $MyInvocation.MyCommand.Path
$scriptDir = if ($scriptPath) { Split-Path -Parent $scriptPath } else { $null }
$binaryPath = if ($scriptDir) { Join-Path $scriptDir "sort_it_now.exe" } else { $null }

function Test-IsAdministrator {
$currentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent()
Expand Down Expand Up @@ -202,7 +203,7 @@ function Install-FromRelease {
}
}

if (Test-Path $binaryPath) {
if ($binaryPath -and (Test-Path $binaryPath)) {
Install-LocalBinary -BinaryPath $binaryPath -TargetDirectory $Destination -ReadmeSource (Join-Path $scriptDir "README.md")
}
else {
Expand Down
Loading