mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 13:30:03 +00:00
Use tabs
This commit is contained in:
parent
994f0bec47
commit
baf9479bf9
1 changed files with 18 additions and 18 deletions
36
src/rust.ts
36
src/rust.ts
|
@ -94,27 +94,27 @@ export function detectToolchain(): Toolchain {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
core.info('Loading rust-toolchain.toml or rust-toolchain file');
|
core.info('Loading rust-toolchain.toml or rust-toolchain file');
|
||||||
const toolchainFile = core.getInput('rust-toolchain-file');
|
const toolchainFile = core.getInput('rust-toolchain-file');
|
||||||
|
|
||||||
if (toolchainFile) {
|
if (toolchainFile) {
|
||||||
if (fs.existsSync(toolchainFile)) {
|
if (fs.existsSync(toolchainFile)) {
|
||||||
Object.assign(toolchain, parseConfig(toolchainFile));
|
Object.assign(toolchain, parseConfig(toolchainFile));
|
||||||
} else {
|
} else {
|
||||||
core.setFailed('Not found toolchain config file');
|
core.setFailed('Not found toolchain config file');
|
||||||
throw new Error('Not found toolchain config file');
|
throw new Error('Not found toolchain config file');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (const configName of ['rust-toolchain.toml', 'rust-toolchain']) {
|
for (const configName of ['rust-toolchain.toml', 'rust-toolchain']) {
|
||||||
const configPath = path.join(process.cwd(), configName);
|
const configPath = path.join(process.cwd(), configName);
|
||||||
|
|
||||||
if (fs.existsSync(configPath)) {
|
if (fs.existsSync(configPath)) {
|
||||||
core.debug(`Found ${configName}, parsing TOML`);
|
core.debug(`Found ${configName}, parsing TOML`);
|
||||||
|
|
||||||
Object.assign(toolchain, parseConfig(configPath));
|
Object.assign(toolchain, parseConfig(configPath));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info('Inheriting toolchain settings from inputs');
|
core.info('Inheriting toolchain settings from inputs');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue