Add checking if the specified file exist

This commit is contained in:
jojo43 2022-05-01 12:09:36 +09:00
parent dbe1872ad4
commit 1fefa4e324
2 changed files with 20 additions and 13 deletions

View file

@ -120,6 +120,11 @@ function resolveVersionInput(): string {
}
if (versionFilePath) {
if (!fs.existsSync(versionFilePath)) {
throw new Error(
`The specified go version file at: ${versionFilePath} does not exist`
);
}
version = installer.parseGoVersionFile(versionFilePath);
}