rs-toolchain/src/args.ts

27 lines
827 B
TypeScript
Raw Normal View History

2019-09-12 16:44:29 +03:00
import * as core from '@actions/core';
2019-10-16 15:12:53 +03:00
import {input} from '@actions-rs/core';
2019-09-12 16:44:29 +03:00
export interface ToolchainOptions {
name: string,
2019-10-16 15:12:53 +03:00
target: string | undefined,
2019-09-12 16:44:29 +03:00
default: boolean,
2019-10-16 15:12:53 +03:00
override: boolean,
profile: string | undefined,
components: string[] | undefined,
2019-09-12 16:44:29 +03:00
}
export function toolchain_args(): ToolchainOptions {
2019-10-16 15:12:53 +03:00
let components: string[] | undefined = input.getInputList('components');
if (components && components.length === 0) {
components = undefined;
}
2019-09-12 16:44:29 +03:00
return {
2019-10-16 15:12:53 +03:00
name: input.getInput('toolchain', {required: true}),
target: input.getInput('target') || undefined,
default: input.getInputBool('default'),
override: input.getInputBool('override'),
profile: input.getInput('profile') || undefined,
components: components,
};
2019-09-12 16:44:29 +03:00
}