mirror of
https://github.com/actions-rs/cargo.git
synced 2025-12-16 03:15:45 +02:00
Installing specific cross revision from git (see #1)
This commit is contained in:
parent
4630dea632
commit
de5e75cc84
3 changed files with 17 additions and 90 deletions
84
src/input.ts
84
src/input.ts
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as exec_tr from '@actions/exec/lib/toolrunner';
|
||||
|
||||
// Workaround for a GH bug: https://github.com/actions/toolkit/issues/127
|
||||
//
|
||||
|
|
@ -42,7 +41,8 @@ export interface Input {
|
|||
|
||||
export function parse(): Input {
|
||||
const command = getInput('command');
|
||||
const args = exec_tr.argStringToArray(getInput('args'));
|
||||
// TODO: This probably will strike back later
|
||||
const args = getInput('args').split(' ');
|
||||
let toolchain = getInput('toolchain');
|
||||
if (toolchain.startsWith('+')) {
|
||||
toolchain = toolchain.slice(1);
|
||||
|
|
@ -56,83 +56,3 @@ export function parse(): Input {
|
|||
toolchain: toolchain || undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// import * as core from '@actions/core';
|
||||
//
|
||||
// // Workaround for a GH bug: https://github.com/actions/toolkit/issues/127
|
||||
// //
|
||||
// // For input `all-features: true` it will generate the `INPUT_ALL-FEATURES: true`
|
||||
// // env variable, which looks too weird.
|
||||
// // Here we are trying to get proper name `INPUT_NO_DEFAULT_FEATURES` first,
|
||||
// // and if it does not exist, trying the `INPUT_NO-DEFAULT-FEATURES`
|
||||
// function getInput(name: string): string {
|
||||
// const inputFullName = name.replace(/-/g, '_');
|
||||
// let value = core.getInput(inputFullName);
|
||||
// if (value.length > 0) {
|
||||
// return value
|
||||
// }
|
||||
//
|
||||
// return core.getInput(name)
|
||||
// }
|
||||
//
|
||||
// function inputFlag(name: string): string | null {
|
||||
// const value = getInput(name);
|
||||
// if (value == 'true' || value == '1') {
|
||||
// return `--${name}`;
|
||||
// }
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// function inputString(name: string): string | null {
|
||||
// const value = getInput(name);
|
||||
// if (value.length > 0) {
|
||||
// return `--${name}=${value}`;
|
||||
// }
|
||||
//
|
||||
// return null
|
||||
// }
|
||||
//
|
||||
// const INPUT_GENERATOR: Array<() => string | null> = [
|
||||
// () => inputFlag('quiet'),
|
||||
// () => inputString('package'),
|
||||
// () => inputFlag('all'),
|
||||
// () => inputString('exclude'),
|
||||
// () => inputFlag('lib'),
|
||||
// () => inputString('bin'),
|
||||
// () => inputFlag('bins'),
|
||||
// () => inputString('example'),
|
||||
// () => inputFlag('examples'),
|
||||
// () => inputString('test'),
|
||||
// () => inputFlag('tests'),
|
||||
// () => inputString('bench'),
|
||||
// () => inputFlag('benches'),
|
||||
// () => inputFlag('all-targets'),
|
||||
// () => inputFlag('release'),
|
||||
// () => inputString('profile'),
|
||||
// () => inputString('features'),
|
||||
// () => inputFlag('all-features'),
|
||||
// () => inputFlag('no-default-features'),
|
||||
// () => inputString('target'),
|
||||
// () => inputString('target-dir'),
|
||||
// () => inputString('manifest-path'),
|
||||
// () => inputFlag('frozen'),
|
||||
// () => inputFlag('locked')
|
||||
// ];
|
||||
//
|
||||
// // All `cargo check` args are optional,
|
||||
// // but we need to do some validation at least
|
||||
// export function check_args(): string[] {
|
||||
// let args: string[] = ['check'];
|
||||
// for (const caller of INPUT_GENERATOR) {
|
||||
// const arg = caller();
|
||||
// if (arg == null) {
|
||||
// continue
|
||||
// } else {
|
||||
// args.push(arg);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return args
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue