From e452967449b1c4aa54a7a811e84448d31ad6e719 Mon Sep 17 00:00:00 2001 From: Yoshihisa Mochihara Date: Fri, 11 Oct 2024 16:19:28 +0200 Subject: [PATCH] Fix version includes line break We can see the differences `uv --version` in different platforms: OSX: uv 0.4.20 (0e1b25a53 2024-10-08)\n Linux: uv 0.4.20\n In getVersion function we split the output by space and return the second part. This commit trims the version number to remove the line break. --- dist/setup/index.js | 2 +- src/download/download-latest.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 101d5fe..23bd3ca 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -90020,7 +90020,7 @@ function getVersion(uvExecutablePath) { }; yield exec.exec(uvExecutablePath, execArgs, options); const parts = output.split(" "); - return parts[1]; + return parts[1].trim(); }); } diff --git a/src/download/download-latest.ts b/src/download/download-latest.ts index de9f4ff..6f173e0 100644 --- a/src/download/download-latest.ts +++ b/src/download/download-latest.ts @@ -67,5 +67,5 @@ async function getVersion(uvExecutablePath: string): Promise { }; await exec.exec(uvExecutablePath, execArgs, options); const parts = output.split(" "); - return parts[1]; + return parts[1].trim(); }