import { Logger } from "../utils/logger" ; import { CheckInInfo } from "../entities/checkininfo" ; import { CvsProviderProxy } from "../../dal/cvsproviderproxy" ; import { inject , injectable } from "inversify" ; import { TYPES } from "../utils/constants" ; import { IResourceProvider } from "../../view/dataproviders/interfaces/iresourceprovider" ; import { WindowProxy } from "../moduleproxies/window-proxy" ; @ injectable ( ) export class SelectFilesForRemoteRun implements Command { public constructor ( @ inject ( TYPES . CvsProviderProxy ) private readonly cvsProvider , @ inject ( TYPES . ResourceProvider ) private readonly resourceProvider , @ inject ( TYPES . WindowProxy ) private readonly windowsProxy ) { } public async exec ( args ? ) { Logger . logInfo ( "SelectFilesForRemoteRun#exec: start" ) ; const checkInArrayPromise = this . cvsProvider . getRequiredCheckInInfo ( ) ; this . windowsProxy . showWithProgress ( "Collecting changes..." , checkInArrayPromise ) ; const checkInInfo = await checkInArrayPromise ; SelectFilesForRemoteRun . ensureChangesPresent ( checkInInfo ) ; this . resourceProvider . setContent ( checkInInfo ) ; } private static ensureChangesPresent ( checkInInfo ) { if ( checkInInfo . length === 0 ) { throw new Error ( "No changes detected" ) ; } } }