Rewrite codes

This commit is contained in:
MikuroXina 2022-02-20 22:09:14 +09:00
parent 42dbaf80f9
commit dfb7371848
No known key found for this signature in database
GPG key ID: C8F29756BC44FE0A
5 changed files with 196 additions and 23 deletions

View file

@ -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,