import { FxError, LogProvider, Result } from "@microsoft/teamsfx-api"; import child_process from "child_process"; import { ScriptExecutionError, ScriptTimeoutError } from "../../../error/script"; import { DotenvOutput } from "../../utils/envUtil"; import { DriverContext } from "../interface/commonArgs"; import { ExecutionResult, StepDriver } from "../interface/stepDriver"; interface ScriptDriverArgs { run: string; workingDirectory?: string; shell?: string; timeout?: number; redirectTo?: string; } /** * Get the default shell for the current platform: * - If `SHELL` environment variable is set, return its value. otherwise: * - On macOS, return `/bin/zsh` if it exists, otherwise return `/bin/bash`. * - On Windows, return the value of the `ComSpec` environment variable if it exists, otherwise return `cmd.exe`. * - On Linux, return `/bin/sh`. */ export declare function defaultShell(): Promise; export declare class ScriptDriver implements StepDriver { _run(typedArgs: ScriptDriverArgs, context: DriverContext): Promise, FxError>>; execute(args: unknown, ctx: DriverContext): Promise; } export declare const scriptDriver: ScriptDriver; export declare function executeCommand(command: string, projectPath: string, logProvider: LogProvider, ui: DriverContext["ui"], workingDirectory?: string, env?: NodeJS.ProcessEnv, shell?: string, timeout?: number, redirectTo?: string): Promise>; export declare function getStderrHandler(logProvider: LogProvider, systemEncoding: string, stderrStrings: string[], dataHandler: (data: string) => void): (data: Buffer) => void; export declare function bufferToString(data: Buffer, systemEncoding: string): string; export declare function convertScriptErrorToFxError(error: child_process.ExecException, run: string): ScriptTimeoutError | ScriptExecutionError; export declare function parseSetOutputCommand(stdout: string): DotenvOutput; export {}; //# sourceMappingURL=scriptDriver.d.ts.map