mirror of
https://github.com/actions-rs/cargo.git
synced 2025-08-15 05:05:10 +00:00
Merge a527bf4d534717ff4424a84446c5d710f8833139 into d64d910352041e99ae409ff64bdb3bb021e2812d
This commit is contained in:
commit
c501dd4cad
@ -17,6 +17,9 @@ inputs:
|
|||||||
use-cross:
|
use-cross:
|
||||||
description: Use cross instead of cargo
|
description: Use cross instead of cargo
|
||||||
default: false
|
default: false
|
||||||
|
working-directory:
|
||||||
|
description: Where to start the cargo process
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -10,6 +10,7 @@ import stringArgv from "string-argv";
|
|||||||
export interface Input {
|
export interface Input {
|
||||||
command: string;
|
command: string;
|
||||||
toolchain?: string;
|
toolchain?: string;
|
||||||
|
"working-directory"?: string;
|
||||||
args: string[];
|
args: string[];
|
||||||
useCross: boolean;
|
useCross: boolean;
|
||||||
}
|
}
|
||||||
@ -22,11 +23,13 @@ export function get(): Input {
|
|||||||
toolchain = toolchain.slice(1);
|
toolchain = toolchain.slice(1);
|
||||||
}
|
}
|
||||||
const useCross = input.getInputBool("use-cross");
|
const useCross = input.getInputBool("use-cross");
|
||||||
|
const workingDir = input.getInput("working-directory");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
command: command,
|
command: command,
|
||||||
args: args,
|
args: args,
|
||||||
useCross: useCross,
|
useCross: useCross,
|
||||||
toolchain: toolchain || undefined,
|
toolchain: toolchain || undefined,
|
||||||
|
"working-directory": workingDir || undefined
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,10 @@ export async function run(actionInput: input.Input): Promise<void> {
|
|||||||
args.push(actionInput.command);
|
args.push(actionInput.command);
|
||||||
args = args.concat(actionInput.args);
|
args = args.concat(actionInput.args);
|
||||||
|
|
||||||
|
if (actionInput["working-directory"]) {
|
||||||
|
process.chdir(path.join(process.cwd(), actionInput["working-directory"]))
|
||||||
|
}
|
||||||
|
|
||||||
await program.call(args);
|
await program.call(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user