mirror of
https://github.com/actions-rs/cargo.git
synced 2024-11-14 13:36:33 +02:00
e35786a472
Add problem matcher for cargo output
32 lines
749 B
TypeScript
32 lines
749 B
TypeScript
/**
|
|
* Parse action input into a some proper thing.
|
|
*/
|
|
|
|
import {input} from '@actions-rs/core';
|
|
|
|
import stringArgv from 'string-argv';
|
|
|
|
// Parsed action input
|
|
export interface Input {
|
|
command: string,
|
|
toolchain?: string,
|
|
args: string[],
|
|
useCross: boolean,
|
|
}
|
|
|
|
export function get(): Input {
|
|
const command = input.getInput('command', {required: true});
|
|
const args = stringArgv(input.getInput('args'));
|
|
let toolchain = input.getInput('toolchain');
|
|
if (toolchain.startsWith('+')) {
|
|
toolchain = toolchain.slice(1);
|
|
}
|
|
const useCross = input.getInputBool('use-cross');
|
|
|
|
return {
|
|
command: command,
|
|
args: args,
|
|
useCross: useCross,
|
|
toolchain: toolchain || undefined
|
|
}
|
|
}
|