From b6efa9c8823174259f982e8f5e5739ae5349dacf Mon Sep 17 00:00:00 2001 From: Lionel Faber Date: Mon, 3 Jan 2022 16:16:26 +0530 Subject: [PATCH] Fix rustup download & installation on Windows when downloading the rustup-init binary for installation on Windows it should be named rustup-init.exe in order to be executable on the runner --- src/commands/rustup.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commands/rustup.ts b/src/commands/rustup.ts index 148351bc..5f6ca64d 100644 --- a/src/commands/rustup.ts +++ b/src/commands/rustup.ts @@ -1,6 +1,7 @@ import { promises as fs } from 'fs'; import * as path from 'path'; import * as process from 'process'; +import * as os from 'os'; import * as semver from 'semver'; import * as io from '@actions/io'; @@ -73,8 +74,11 @@ export class RustUp { } case 'win32': { + const downloadPath = path.join(os.tmpdir(), "rustup-init.exe"); + await fs.rm(downloadPath, { force: true }); const rustupExe = await tc.downloadTool( 'https://win.rustup.rs', + downloadPath, ); await exec.exec(rustupExe, args); break;