baldrick-broth
Version:
Build automation tool and task runner
45 lines (44 loc) • 1.36 kB
TypeScript
import { type AnyDataValue, type AnyCommand, type Ctx, type onCommandSuccess, type onCommandFailure } from './build-model.js';
import { type Result } from './railway.js';
type ExecuteCommandLineFailedCategory = 'failed' | 'canceled' | 'timeout' | 'killed' | 'parse-json-failed' | 'parse-yaml-failed' | 'parse-csv-failed';
export type CommandLineInput = {
memoryId: string;
line: string;
name: string;
opts: AnyCommand;
extra: Record<string, any>;
};
type ExecuteCommandLineFailure = {
category: ExecuteCommandLineFailedCategory;
line: string;
stdout: string;
stderr: string;
exitCode: number;
message: string;
onFailure: onCommandFailure[];
};
type ExecuteCommandLineSuccess = {
format: 'string';
line: string;
name: string;
data: string;
onSuccess: onCommandSuccess[];
} | {
format: 'json';
line: string;
name: string;
data: AnyDataValue;
onSuccess: onCommandSuccess[];
} | {
format: 'csv';
line: string;
name: string;
data: AnyDataValue;
onSuccess: onCommandSuccess[];
};
type ExecuteCommandLineResult = Result<ExecuteCommandLineSuccess, ExecuteCommandLineFailure>;
/**
* Executes a command after template expansion
*/
export declare const executeCommandLine: (ctx: Ctx, params: CommandLineInput) => Promise<ExecuteCommandLineResult>;
export {};