Allow to override toolchain from rust-toolchain file (#35)

This commit is contained in:
Thomas Eizinger 2020-01-14 00:31:26 +11:00 committed by svartalf
parent e2aeba25b2
commit 6a1db6369e
10 changed files with 168 additions and 34 deletions

View file

@ -1,12 +1,16 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as io from '@actions/io';
import path from "path";
import * as args from './args';
import {RustUp, ToolchainOptions} from '@actions-rs/core';
async function run() {
const opts = args.toolchain_args();
// we use path.join to make sure this works on Windows, Linux and MacOS
let toolchainOverrideFile = path.join(process.cwd(), "rust-toolchain");
const opts = args.toolchain_args(toolchainOverrideFile);
const rustup = await RustUp.getOrInstall();
await rustup.call(['show']);