mirror of
https://github.com/actions-rs/cargo.git
synced 2025-12-18 04:15:47 +02:00
Rewrite codes
This commit is contained in:
parent
42dbaf80f9
commit
dfb7371848
5 changed files with 196 additions and 23 deletions
11
src/input.ts
11
src/input.ts
|
|
@ -2,8 +2,7 @@
|
|||
* Parse action input into a some proper thing.
|
||||
*/
|
||||
|
||||
import { input } from "@actions-rs/core";
|
||||
|
||||
import { getInput } from "@actions/core";
|
||||
import stringArgv from "string-argv";
|
||||
|
||||
// Parsed action input
|
||||
|
|
@ -15,13 +14,13 @@ export interface Input {
|
|||
}
|
||||
|
||||
export function get(): Input {
|
||||
const command = input.getInput("command", { required: true });
|
||||
const args = stringArgv(input.getInput("args"));
|
||||
let toolchain = input.getInput("toolchain");
|
||||
const command = getInput("command", { required: true });
|
||||
const args = stringArgv(getInput("args"));
|
||||
let toolchain = getInput("toolchain");
|
||||
if (toolchain.startsWith("+")) {
|
||||
toolchain = toolchain.slice(1);
|
||||
}
|
||||
const useCross = input.getInputBool("use-cross");
|
||||
const useCross = getInput("use-cross") === "true";
|
||||
|
||||
return {
|
||||
command: command,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue