From b82d7b7e8500e2c69bf9d74b71bbe14bce94be99 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 10:59:53 +0200 Subject: [PATCH 1/2] Simplify install/uninstall to direct single-line commands (#33) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --- README.md | 25 +++++++------------------ scripts/install-unix.sh | 12 ++++++++---- scripts/install-windows.ps1 | 7 ++++--- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b154fd8..441ca0f 100644 --- a/README.md +++ b/README.md @@ -98,46 +98,35 @@ 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 `` 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=` 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//scripts/install-unix.sh - chmod +x /tmp/sort-it-now-install-unix.sh - SORT_IT_NOW_VERSION= /tmp/sort-it-now-install-unix.sh + curl -fsSL https://raw.githubusercontent.com/JosunLP/sort-it-now//scripts/install-unix.sh | SORT_IT_NOW_VERSION= bash ``` - Linux / macOS uninstall: ```bash - curl -fsSLo /tmp/sort-it-now-uninstall-unix.sh \ - https://raw.githubusercontent.com/JosunLP/sort-it-now//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//scripts/uninstall-unix.sh | bash ``` - Windows install (PowerShell): ```powershell - $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=""; irm "https://raw.githubusercontent.com/JosunLP/sort-it-now//scripts/install-windows.ps1" | iex ``` - Windows uninstall (PowerShell): ```powershell - $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//scripts/uninstall-windows.ps1" | iex ``` +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) to override the default target. ### Archive Installation Scripts diff --git a/scripts/install-unix.sh b/scripts/install-unix.sh index ed89094..8d9c0ef 100644 --- a/scripts/install-unix.sh +++ b/scripts/install-unix.sh @@ -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 @@ -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 diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 66a6c27..0112389 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -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() @@ -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 { From 489297544e6b291981ede2e7eb3d4adbab7e08b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 09:51:48 +0000 Subject: [PATCH 2/2] Clarify Windows streamed install elevation Agent-Logs-Url: https://github.com/JosunLP/sort-it-now/sessions/fc712359-8453-400e-8dd8-1bc9529374c4 Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 441ca0f..9347171 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ You can additionally set `SORT_IT_NOW_VERSION=` to instruct the install curl -fsSL https://raw.githubusercontent.com/JosunLP/sort-it-now//scripts/uninstall-unix.sh | bash ``` -- Windows install (PowerShell): +- Windows install (PowerShell, run as Administrator for the default destination under `%ProgramFiles%`): ```powershell $env:SORT_IT_NOW_VERSION=""; irm "https://raw.githubusercontent.com/JosunLP/sort-it-now//scripts/install-windows.ps1" | iex @@ -127,7 +127,7 @@ You can additionally set `SORT_IT_NOW_VERSION=` to instruct the install 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) to override the default target. +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