Skip to content

Commit be9fd18

Browse files
committed
Merge branch 'trs/preserve-standalone-installer-destination'
2 parents 95dd491 + 5140dda commit be9fd18

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ supported Python version is always bundled with `nextstrain`.
8181
in the wrong location.
8282
([#476](https://github.com/nextstrain/cli/issues/476))
8383

84+
* When a standalone installation of Nextstrain CLI suggests a command to run to
85+
update itself, that command now takes into account non-default installation
86+
paths so that the new version is installed to the same place as the current
87+
version.
88+
([#474](https://github.com/nextstrain/cli/pull/474))
89+
8490
# 10.2.1.post1 (1 July 2025)
8591

8692
_See also changes in 10.2.1 which was an unreleased version._

doc/changes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ supported Python version is always bundled with `nextstrain`.
8686
in the wrong location.
8787
([#476](https://github.com/nextstrain/cli/issues/476))
8888

89+
* When a standalone installation of Nextstrain CLI suggests a command to run to
90+
update itself, that command now takes into account non-default installation
91+
paths so that the new version is installed to the same place as the current
92+
version.
93+
([#474](https://github.com/nextstrain/cli/pull/474))
94+
8995
(v10-2-1-post1)=
9096
## 10.2.1.post1 (1 July 2025)
9197

nextstrain/cli/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,16 @@ def standalone_installation_path() -> Optional[Path]:
235235

236236
def standalone_installer(version: str) -> str:
237237
system = platform.system()
238+
destination = str(standalone_installation_path() or "")
238239

239240
if system == "Linux":
240-
return f"curl -fsSL --proto '=https' https://nextstrain.org/cli/installer/linux | bash -s {shquote(version)}"
241+
return f"curl -fsSL --proto '=https' https://nextstrain.org/cli/installer/linux | DESTINATION={shquote(destination)} bash -s {shquote(version)}"
241242

242243
elif system == "Darwin":
243-
return f"curl -fsSL --proto '=https' https://nextstrain.org/cli/installer/mac | bash -s {shquote(version)}"
244+
return f"curl -fsSL --proto '=https' https://nextstrain.org/cli/installer/mac | DESTINATION={shquote(destination)} bash -s {shquote(version)}"
244245

245246
elif system == "Windows":
246-
return 'Invoke-Expression "& { $(Invoke-RestMethod https://nextstrain.org/cli/installer/windows) } %s"' % shquote(version)
247+
return '$env:DESTINATION=%s; Invoke-Expression "& { $(Invoke-RestMethod https://nextstrain.org/cli/installer/windows) } %s"' % (shquote(destination), shquote(version))
247248

248249
else:
249250
raise RuntimeError(f"unknown system {system!r}")

0 commit comments

Comments
 (0)