fix fnm version check (#2014)
This commit is contained in:
parent
490ae40a40
commit
d00425276d
@ -247,13 +247,13 @@ def output_system_info():
|
||||
if system != "Windows":
|
||||
dependencies.extend(
|
||||
[
|
||||
f"[FNM {constants.Fnm.VERSION} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]",
|
||||
f"[FNM {prerequisites.get_fnm_version()} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]",
|
||||
f"[Bun {prerequisites.get_bun_version()} (Expected: {constants.Bun.VERSION}) (PATH: {config.bun_path})]",
|
||||
],
|
||||
)
|
||||
else:
|
||||
dependencies.append(
|
||||
f"[FNM {constants.Fnm.VERSION} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]",
|
||||
f"[FNM {prerequisites.get_fnm_version()} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]",
|
||||
)
|
||||
|
||||
if system == "Linux":
|
||||
|
@ -60,6 +60,19 @@ def get_node_version() -> version.Version | None:
|
||||
return None
|
||||
|
||||
|
||||
def get_fnm_version() -> version.Version | None:
|
||||
"""Get the version of fnm.
|
||||
|
||||
Returns:
|
||||
The version of FNM.
|
||||
"""
|
||||
try:
|
||||
result = processes.new_process([constants.Fnm.EXE, "--version"], run=True)
|
||||
return version.parse(result.stdout.split(" ")[1]) # type: ignore
|
||||
except (FileNotFoundError, TypeError):
|
||||
return None
|
||||
|
||||
|
||||
def get_bun_version() -> version.Version | None:
|
||||
"""Get the version of bun.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user