add an input argument to specify whether to run 'rustup self update'
This commit is contained in:
parent
941154aed5
commit
db898a40d0
|
@ -19,6 +19,9 @@ inputs:
|
|||
override:
|
||||
description: Set installed toolchain as an override for a directory
|
||||
default: false
|
||||
self_update:
|
||||
description: Update rustup itself at first
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: 'node12'
|
||||
|
|
|
@ -30,7 +30,8 @@ export interface ToolchainOptions {
|
|||
name: string,
|
||||
target?: string,
|
||||
default: boolean,
|
||||
override: boolean
|
||||
override: boolean,
|
||||
self_update: boolean,
|
||||
}
|
||||
|
||||
export function toolchain_args(): ToolchainOptions {
|
||||
|
@ -38,6 +39,7 @@ export function toolchain_args(): ToolchainOptions {
|
|||
name: getInput('toolchain', {required: true}),
|
||||
target: getInput('target') || undefined,
|
||||
default: inputBoolean('default'),
|
||||
override: inputBoolean('override')
|
||||
override: inputBoolean('override'),
|
||||
self_update: inputBoolean('self_update'),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -74,6 +74,10 @@ async function run() {
|
|||
const opts = args.toolchain_args();
|
||||
const rustup = await get_rustup(opts.name);
|
||||
|
||||
if (opts.self_update) {
|
||||
await exec.exec(rustup, ['self', 'update']);
|
||||
}
|
||||
|
||||
await exec.exec(rustup, ['toolchain', 'install', opts.name]);
|
||||
|
||||
if (opts.default) {
|
||||
|
|
Loading…
Reference in New Issue