/// import { ExecSyncOptions } from 'child_process'; import shelljs from 'shelljs'; /** * 利用child_process来执行一段命令行 * @param cmd 要执行的命令字符串 * @param options 执行命令的配置 */ declare function execSync(cmd: string, options?: ExecSyncOptions): string; interface IExecOptions { /** 当执行命令行失败时,是否退出进程 */ exitIfError: boolean; } /** * 利用shelljs来执行一段命令行字符串 * @param cmdStr 要执行的命令行字符串,可以换行 * @param options 执行命令行的配置 */ declare function execAllShell(cmdStr: string, options?: IExecOptions): void; /** * 切换执行命令行的所在路径 * @example `cd ..`为返回上一级,`cd -`回到前一目录。 * Changes the current working directory dir for the duration of the script. * Changes to the home directory if no argument is supplied. * * @param dir Directory to change to. * @return Object with shell exit code, stderr and stdout. */ declare function cd(dir?: string): shelljs.ShellString; export { execSync, execAllShell, shelljs, cd };