Add components
support as an input
This commit is contained in:
@@ -6,11 +6,19 @@ import * as os from 'os';
|
||||
async function run() {
|
||||
try {
|
||||
const version = core.getInput('rust-version');
|
||||
const components = core.getInput('components')
|
||||
.split(',')
|
||||
.map((component) => component.trim())
|
||||
.filter((component) => component.length > 0);
|
||||
|
||||
if(version) {
|
||||
await rustup.install();
|
||||
await exec.exec('rustup', ['default', version]);
|
||||
await exec.exec('rustup', ['update', version]);
|
||||
|
||||
for(let component of components) {
|
||||
await exec.exec('rustup', ['component', 'add', component]);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
Reference in New Issue
Block a user