Use toolchain install instead of multiple commands
This commit is contained in:
11
lib/main.js
11
lib/main.js
@@ -32,14 +32,11 @@ function run() {
|
||||
.filter((target) => target.length > 0);
|
||||
if (version) {
|
||||
yield rustup.install();
|
||||
yield exec.exec('rustup', ['toolchain', 'install', version,
|
||||
...(components.length > 0 ? ['-c', ...components] : []),
|
||||
...(targets.length > 0 ? ['-t', ...targets] : []),
|
||||
]);
|
||||
yield exec.exec('rustup', ['default', version]);
|
||||
yield exec.exec('rustup', ['update', version]);
|
||||
for (let component of components) {
|
||||
yield exec.exec('rustup', ['component', 'add', component]);
|
||||
}
|
||||
for (let target of targets) {
|
||||
yield exec.exec('rustup', ['target', 'add', target]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
|
@@ -30,6 +30,11 @@ function install() {
|
||||
core.debug('rustup is located under: ' + toolPath);
|
||||
core.addPath(path.join(toolPath, 'bin'));
|
||||
}
|
||||
else {
|
||||
// update the GitHub managed VM version of rustup
|
||||
// to leverage newer features like "latest latest compatible nightly"
|
||||
yield exec.exec('rustup', ['self', 'update']);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.install = install;
|
||||
|
Reference in New Issue
Block a user