Skip to content

Commit

Permalink
Merge pull request #219 from PyO3/fix-rust-toolchain-undefined
Browse files Browse the repository at this point in the history
Fix undefined rust channel in `rust-toolchain` file
  • Loading branch information
messense authored Oct 7, 2023
2 parents 03e27ee + 71dda5b commit 9ef338c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11515,7 +11515,7 @@ function getManifestDir(args) {
function parseRustToolchain(content) {
const toml = (0, toml_1.parse)(content.toString());
const toolchain = toml === null || toml === void 0 ? void 0 : toml.toolchain;
return toolchain === null || toolchain === void 0 ? void 0 : toolchain.channel;
return (toolchain === null || toolchain === void 0 ? void 0 : toolchain.channel) || '';
}
async function getRustToolchain(args) {
let rustToolchain = core.getInput('rust-toolchain');
Expand Down Expand Up @@ -11940,7 +11940,7 @@ function setupSccacheEnv() {
async function hostBuild(maturinRelease, args) {
const command = core.getInput('command');
const target = getRustTarget(args);
const rustToolchain = await getRustToolchain(args);
const rustToolchain = (await getRustToolchain(args)) || 'stable';
const rustupComponents = core.getInput('rustup-components');
const workdir = getWorkingDirectory();
const sccache = core.getBooleanInput('sccache');
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function getManifestDir(args: string[]): string {
function parseRustToolchain(content: string): string {
const toml = parseTOML(content.toString())
const toolchain = toml?.toolchain as JsonMap
return toolchain?.channel as string
return (toolchain?.channel as string) || ''
}

async function getRustToolchain(args: string[]): Promise<string> {
Expand Down Expand Up @@ -759,7 +759,7 @@ async function hostBuild(
): Promise<number> {
const command = core.getInput('command')
const target = getRustTarget(args)
const rustToolchain = await getRustToolchain(args)
const rustToolchain = (await getRustToolchain(args)) || 'stable'
const rustupComponents = core.getInput('rustup-components')
const workdir = getWorkingDirectory()
const sccache = core.getBooleanInput('sccache')
Expand Down

0 comments on commit 9ef338c

Please sign in to comment.