Add support for rust-toolchain.toml
This commit is contained in:
parent
88dc235639
commit
5613870e6d
10
src/args.ts
10
src/args.ts
|
@ -19,13 +19,19 @@ function determineToolchain(overrideFile: string): string {
|
||||||
return toolchainInput;
|
return toolchainInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existsSync(overrideFile)) {
|
const toolchainPath = existsSync(overrideFile)
|
||||||
|
? overrideFile
|
||||||
|
: existsSync(`${overrideFile}.toml`)
|
||||||
|
? `${overrideFile}.toml`
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
if (!toolchainPath) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"toolchain input was not given and repository does not have a rust-toolchain file"
|
"toolchain input was not given and repository does not have a rust-toolchain file"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const rustToolchainFile = readFileSync(overrideFile, {
|
const rustToolchainFile = readFileSync(toolchainPath, {
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
flag: "r",
|
flag: "r",
|
||||||
}).trim();
|
}).trim();
|
||||||
|
|
Loading…
Reference in New Issue