Fix cache linebreak in linux runner (#118)

Related https://github.com/astral-sh/setup-uv/issues/106

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 PR trims the version number to remove the line break.
This commit is contained in:
Yoshihisa Mochihara 2024-10-12 08:59:22 +02:00 committed by GitHub
parent 77c28f02b3
commit f731690a1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

2
dist/setup/index.js generated vendored
View File

@ -90020,7 +90020,7 @@ function getVersion(uvExecutablePath) {
};
yield exec.exec(uvExecutablePath, execArgs, options);
const parts = output.split(" ");
return parts[1];
return parts[1].trim();
});
}

View File

@ -67,5 +67,5 @@ async function getVersion(uvExecutablePath: string): Promise<string> {
};
await exec.exec(uvExecutablePath, execArgs, options);
const parts = output.split(" ");
return parts[1];
return parts[1].trim();
}