mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-07-30 09:40:13 +00:00
Fallback if toml file parsing failed (#246)
This commit is contained in:
committed by
GitHub
parent
b5f58b2abc
commit
14dc0be27c
@ -9,7 +9,14 @@ export function getUvVersionFromConfigFile(
|
||||
core.warning(`Could not find file: ${filePath}`);
|
||||
return undefined;
|
||||
}
|
||||
let requiredVersion = getRequiredVersion(filePath);
|
||||
let requiredVersion: string | undefined;
|
||||
try {
|
||||
requiredVersion = getRequiredVersion(filePath);
|
||||
} catch (err) {
|
||||
const message = (err as Error).message;
|
||||
core.warning(`Error while parsing ${filePath}: ${message}`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (requiredVersion?.startsWith("==")) {
|
||||
requiredVersion = requiredVersion.slice(2);
|
||||
|
Reference in New Issue
Block a user