add working-directory option
This commit is contained in:
parent
88dc235639
commit
e80cf306a4
|
@ -28,6 +28,8 @@ inputs:
|
|||
components:
|
||||
description: Comma-separated list of components to be additionally installed for a new toolchain
|
||||
required: false
|
||||
working-directory:
|
||||
description: Working directory to use for finding rust-toolchain
|
||||
|
||||
outputs:
|
||||
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;
|
||||
}
|
||||
|
||||
export function setWorkingDirectory() {
|
||||
const workingDirectory = input.getInput("working-directory");
|
||||
if (workingDirectory) {
|
||||
process.chdir(workingDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
export function getToolchainArgs(overrideFile: string): ToolchainOptions {
|
||||
let components: string[] | undefined = input.getInputList("components");
|
||||
if (components && components.length === 0) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import * as versions from "./versions";
|
|||
import { RustUp, ToolchainOptions } from "@actions-rs/core";
|
||||
|
||||
async function run(): Promise<void> {
|
||||
args.setWorkingDirectory();
|
||||
// we use path.join to make sure this works on Windows, Linux and MacOS
|
||||
const toolchainOverridePath = path.join(process.cwd(), "rust-toolchain");
|
||||
|
||||
|
|
Loading…
Reference in New Issue