add working-directory option
This commit is contained in:
parent
88dc235639
commit
e80cf306a4
|
@ -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:
|
||||||
|
|
File diff suppressed because one or more lines are too long
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 New Issue