Do not use target input as a --default-target argument for rustup

This commit is contained in:
svartalf 2019-10-05 23:46:29 +03:00
parent 15b1f315b5
commit 6715f9d030
5 changed files with 5665 additions and 5633 deletions

17
CHANGELOG.md Normal file
View file

@ -0,0 +1,17 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.1] - 2019-10-05
### Changed
- `target` input is not used as a `--default-target` argument for `rustup` anymore (#8)
## [1.0.0] - 2019-09-15
### Added
- First public version

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

11267
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "rust-toolchain",
"version": "1.0.0",
"version": "1.0.1",
"private": false,
"description": "Install the Rust toolchain",
"main": "lib/main.js",

View file

@ -32,7 +32,7 @@ function downloadRustInit(url: string, name: string): Promise<string> {
});
}
async function get_rustup(toolchain: string, target?: string): Promise<string> {
async function get_rustup(toolchain: string): Promise<string> {
try {
const foundPath = await io.which('rustup', true);
core.debug(`Found rustup at ${foundPath}`);
@ -46,10 +46,8 @@ async function get_rustup(toolchain: string, target?: string): Promise<string> {
'--default-toolchain',
toolchain,
];
if (target) {
args.push('--default-host');
args.push(target);
}
// Note: `target` input can't be used here for `--default-host` argument, see #8
switch (process.platform) {
case 'darwin':
@ -74,7 +72,7 @@ async function get_rustup(toolchain: string, target?: string): Promise<string> {
async function run() {
const opts = args.toolchain_args();
const rustup = await get_rustup(opts.name, opts.target);
const rustup = await get_rustup(opts.name);
await exec.exec(rustup, ['toolchain', 'install', opts.name]);