mirror of
https://github.com/actions-rs/toolchain.git
synced 2024-11-14 13:36:33 +02:00
add working-directory option
This commit is contained in:
parent
88dc235639
commit
e80cf306a4
5 changed files with 10162 additions and 15 deletions
|
@ -28,6 +28,8 @@ inputs:
|
||||||
components:
|
components:
|
||||||
description: Comma-separated list of components to be additionally installed for a new toolchain
|
description: Comma-separated list of components to be additionally installed for a new toolchain
|
||||||
required: false
|
required: false
|
||||||
|
working-directory:
|
||||||
|
description: Working directory to use for finding rust-toolchain
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
rustc:
|
rustc:
|
||||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
10165
package-lock.json
generated
10165
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -35,6 +35,13 @@ function determineToolchain(overrideFile: string): string {
|
||||||
return rustToolchainFile;
|
return rustToolchainFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setWorkingDirectory() {
|
||||||
|
const workingDirectory = input.getInput("working-directory");
|
||||||
|
if (workingDirectory) {
|
||||||
|
process.chdir(workingDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getToolchainArgs(overrideFile: string): ToolchainOptions {
|
export function getToolchainArgs(overrideFile: string): ToolchainOptions {
|
||||||
let components: string[] | undefined = input.getInputList("components");
|
let components: string[] | undefined = input.getInputList("components");
|
||||||
if (components && components.length === 0) {
|
if (components && components.length === 0) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import * as versions from "./versions";
|
||||||
import { RustUp, ToolchainOptions } from "@actions-rs/core";
|
import { RustUp, ToolchainOptions } from "@actions-rs/core";
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
|
args.setWorkingDirectory();
|
||||||
// we use path.join to make sure this works on Windows, Linux and MacOS
|
// we use path.join to make sure this works on Windows, Linux and MacOS
|
||||||
const toolchainOverridePath = path.join(process.cwd(), "rust-toolchain");
|
const toolchainOverridePath = path.join(process.cwd(), "rust-toolchain");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue