Fix rustup
installation on Windows
This commit is contained in:
@@ -17,12 +17,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const rustup = __importStar(require("./rustup"));
|
||||
const os = __importStar(require("os"));
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const version = core.getInput('rust-version');
|
||||
if (version && os.platform() != 'win32') {
|
||||
if (version) {
|
||||
yield rustup.install(version);
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,6 @@ function install(version) {
|
||||
}
|
||||
toolPath = path.join(toolPath, 'bin');
|
||||
core.addPath(toolPath);
|
||||
yield exec.exec('rustup', ['update']);
|
||||
});
|
||||
}
|
||||
exports.install = install;
|
||||
@@ -50,17 +49,13 @@ function acquireRust(version) {
|
||||
throw `Failed to download rustup: ${error}`;
|
||||
}
|
||||
if (WINDOWS) {
|
||||
// TODO: Fix this
|
||||
// It currently fails with:
|
||||
// error: 'rustup-init.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'
|
||||
yield io.cp(script, script + '.exe');
|
||||
script += '.exe';
|
||||
const powershell = yield io.which('powershell', true);
|
||||
console.log(yield io.which('rustup', true));
|
||||
yield exec.exec(`"${script}"`, [
|
||||
'--default-host',
|
||||
'gnu',
|
||||
'-y',
|
||||
'--default-toolchain',
|
||||
version,
|
||||
'none',
|
||||
]);
|
||||
}
|
||||
else {
|
||||
@@ -72,7 +67,7 @@ function acquireRust(version) {
|
||||
}
|
||||
function rustupUrl() {
|
||||
if (WINDOWS) {
|
||||
return "https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe";
|
||||
return "https://win.rustup.rs";
|
||||
}
|
||||
else {
|
||||
return "https://sh.rustup.rs";
|
||||
|
Reference in New Issue
Block a user