UNPKG

yeoman-generator

Version:

Rails-inspired generator system that provides scaffolding for your apps

47 lines (46 loc) • 2.28 kB
import { type Options as ExecaOptions, type ResultPromise, type SyncOptions, type SyncResult } from 'execa'; import type { BaseGenerator } from '../generator.js'; export declare class SpawnCommandMixin { /** * Resolve the options to spawn a command with, defaulting `cwd` to the destination root. * A command cannot be spawned in a directory that does not exist, so create it on demand. * * @param opt execa options * @returns the options with `cwd` set */ private resolveSpawnOptions; /** * Normalize a command across OS and spawn it (asynchronously). * * @param command program to execute * @param opt execa options options * @see https://github.com/sindresorhus/execa/blob/main/docs/execution.md#command-string */ spawnCommand<const OptionsType extends ExecaOptions>(this: BaseGenerator, command: string, opt?: OptionsType): ResultPromise<OptionsType>; /** * Normalize a command across OS and spawn it (asynchronously). * * @param command program to execute * @param args list of arguments to pass to the program * @param opt execa options options * @see https://github.com/sindresorhus/execa#execafile-arguments-options */ spawn<const OptionsType extends ExecaOptions>(this: BaseGenerator, command: string, args?: readonly string[], opt?: OptionsType): ResultPromise<OptionsType>; /** * Normalize a command across OS and spawn it (synchronously). * * @param command program to execute * @param opt execa options options * @see https://github.com/sindresorhus/execa/blob/main/docs/execution.md#command-string */ spawnCommandSync<const OptionsType extends SyncOptions>(this: BaseGenerator, command: string, opt?: OptionsType): SyncResult<OptionsType>; /** * Normalize a command across OS and spawn it (synchronously). * * @param command program to execute * @param args list of arguments to pass to the program * @param opt execa options options * @see https://github.com/sindresorhus/execa#execafile-arguments-options */ spawnSync<const OptionsType extends SyncOptions>(this: BaseGenerator, command: string, args?: readonly string[], opt?: OptionsType): SyncResult<OptionsType>; }