import { CpProxy } from "../../bll/moduleproxies/cp-proxy" ; import { Logger } from "../../bll/utils/logger" ; import { CvsResource } from "../../bll/entities/cvsresources/cvsresource" ; import { BriefDiffRowsParser } from "./BriefDiffRowsParser" ; export class BriefDiffCommand { public constructor ( private readonly workspaceRootPath , private readonly tfPath , private readonly cpProxy , private readonly briefDiffRowsParser ) { } public async execute ( ) { const result = await this . cpProxy . execAsync ( this . getCommand ( ) ) ; if ( ! result || ! result . stdout ) { Logger . logWarning ( `BriefDiffCommand#exec: result is empty` ) ; throw new Error ( "Can't get list of changed files." ) ; } const statusRows = result . stdout . trim ( ) ; return this . briefDiffRowsParser . tryParseRows ( statusRows ) ; } private getCommand ( ) { return `"${ this . tfPath }" diff /noprompt /format:brief /recursive "${ this . workspaceRootPath }"` ; } }