From 700a2f4f5e9c6f738a5da91c8d2fa311df615d19 Mon Sep 17 00:00:00 2001 From: insertokername <111150085+insertokername@users.noreply.github.com> Date: Thu, 23 May 2024 18:05:38 +0300 Subject: [PATCH] feat(install): Added the ability to specify @ version when installing from url/file location (#5988) --- CHANGELOG.md | 1 + lib/core.ps1 | 2 +- libexec/scoop-install.ps1 | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 539f1f06aa..001ac5798e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - **scoop-search:** Use SQLite for caching apps to speed up local search ([#5851](https://github.com/ScoopInstaller/Scoop/issues/5851), [#5918](https://github.com/ScoopInstaller/Scoop/issues/5918), [#5946](https://github.com/ScoopInstaller/Scoop/issues/5946), [#5949](https://github.com/ScoopInstaller/Scoop/issues/5949), [#5955](https://github.com/ScoopInstaller/Scoop/issues/5955), [#5966](https://github.com/ScoopInstaller/Scoop/issues/5966), [#5967](https://github.com/ScoopInstaller/Scoop/issues/5967), [#5981](https://github.com/ScoopInstaller/Scoop/issues/5981)) - **core:** New cache filename format ([#5929](https://github.com/ScoopInstaller/Scoop/issues/5929)) +- **install:** Added the ability to install specific version of app from URL/file link ([#5988](https://github.com/ScoopInstaller/Scoop/issues/5988)) ### Bug Fixes diff --git a/lib/core.ps1 b/lib/core.ps1 index e9311eb9cf..2ecde7ae5a 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -1192,7 +1192,7 @@ function applist($apps, $global) { } function parse_app([string]$app) { - if ($app -match '^(?:(?[a-zA-Z0-9-_.]+)/)?(?.*\.json$|[a-zA-Z0-9-_.]+)(?:@(?.*))?$') { + if ($app -match '^(?:(?[a-zA-Z0-9-_.]+)/)?(?.*\.json|[a-zA-Z0-9-_.]+)(?:@(?.*))?$') { return $Matches['app'], $Matches['bucket'], $Matches['version'] } else { return $app, $null, $null diff --git a/libexec/scoop-install.ps1 b/libexec/scoop-install.ps1 index 8d12a9fee9..173bcd868f 100644 --- a/libexec/scoop-install.ps1 +++ b/libexec/scoop-install.ps1 @@ -10,9 +10,15 @@ # To install an app from a manifest at a URL: # scoop install https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/runat.json # +# To install a different version of the app from a URL: +# scoop install https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/neovim.json@0.9.0 +# # To install an app from a manifest on your computer # scoop install \path\to\app.json # +# To install an app from a manifest on your computer +# scoop install \path\to\app.json@version +# # Options: # -g, --global Install the app globally # -i, --independent Don't install dependencies automatically