UNPKG

europa-build

Version:

Tool for generating and maintaining Europa plugins and presets

51 lines (50 loc) 2.51 kB
import { CommonScriptProvider, CommonScriptProviderOptions } from "./CommonScriptProvider"; /** * An abstract {@link ScriptProvider} that provides logic useful for executing commands to support scripts. */ export declare abstract class CommandScriptProvider extends CommonScriptProvider { /** * Creates an instance of {@link CommandScriptProvider} using the `options` provided. * * @param options - The options to be used. */ protected constructor(options: CommandScriptProviderOptions); /** * Executes the command with the specified name using the `args` provided within the given directory and returns * anything written to STDOUT by the command. * * @param directoryPath - The path of the directory in which the command should be executed. * @param commandName - The name of the command to be executed. * @param [args] - Any arguments to be passed to the command during execution. * @return Anything written to STDOUT by the command. * @throws If an error occurs while attempting to execute the command. */ protected exec(directoryPath: string, commandName: string, args?: string[]): Promise<string>; /** * Executes the bundled command with the specified name using the `args` provided within the given directory and * returns anything written to STDOUT by the command. * * @param directoryPath - The path of the directory in which the command should be executed. * @param commandName - The name of the bundled command to be executed. * @param [args] - Any arguments to be passed to the bundled command during execution. * @return Anything written to STDOUT by the bundled command. * @throws If an error occurs while attempting to execute the bundled command. */ protected execBundledCommand(directoryPath: string, commandName: string, args?: string[]): Promise<string>; /** * Returns the path of the bundled command. * * @param commandName - The name of the bundled command whose path is to be returned. * @return The path of the bundled command. */ protected getBundledCommandPath(commandName: string): Promise<string>; private static getExecErrorMessage; private static hasErrorField; private static hasErrorStderr; private static hasErrorStdout; private logCommandOutput; } /** * The options used by {@link CommandScriptProvider}. */ export declare type CommandScriptProviderOptions = CommonScriptProviderOptions;