mirror of
https://github.com/actions-rs/toolchain.git
synced 2025-09-07 00:31:57 +03:00
Initial version
This commit is contained in:
commit
644dd49b85
12 changed files with 5315 additions and 0 deletions
27
src/main.ts
Normal file
27
src/main.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
import * as args from './args';
|
||||
|
||||
async function do_exec(program: string, args: string[]) {
|
||||
try {
|
||||
await exec.exec(program, args);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
let opts = args.toolchain_args();
|
||||
await do_exec('rustup', ['toolchain', 'install', opts.name]);
|
||||
|
||||
if (opts.default) {
|
||||
await do_exec('rustup', ['default', opts.name]);
|
||||
}
|
||||
|
||||
if (opts.override) {
|
||||
await do_exec('rustup', ['override', opts.name]);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
Loading…
Add table
Add a link
Reference in a new issue