From b3b2f56890b6831199bd86062667993125b36806 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 19 Aug 2024 10:25:51 +0530 Subject: [PATCH] Installer: allow installing specific versions --- docs/binary.rst | 4 ++-- docs/installer.sh | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/binary.rst b/docs/binary.rst index 534e4fdfe..05a9f77e9 100644 --- a/docs/binary.rst +++ b/docs/binary.rst @@ -99,12 +99,12 @@ Customizing the installation _kitty_install_cmd \ installer=nightly dest=/some/other/location -* You can specify a different install location, with ``dest``: +* You can specify a specific version to install, with: .. code-block:: sh _kitty_install_cmd \ - dest=/some/other/location + installer=version-0.35.2 * You can tell the installer not to launch |kitty| after installing it with ``launch=n``: diff --git a/docs/installer.sh b/docs/installer.sh index 6336e30c6..4a31c109f 100644 --- a/docs/installer.sh +++ b/docs/installer.sh @@ -98,6 +98,9 @@ get_release_url() { get_file_url "v$release_version" "$release_version" } +get_version_url() { + get_file_url "v$1" "$1" +} get_nightly_url() { get_file_url "nightly" "nightly" @@ -105,9 +108,11 @@ get_nightly_url() { get_download_url() { installer_is_file="n" + echo "$installer" case "$installer" in "nightly") get_nightly_url ;; "") get_release_url ;; + version-*) get_version_url "${installer#*-}";; *) installer_is_file="y" ;; esac }