Record information about which files are wiped (#1997)
This commit is contained in:
Родитель
2ff7c2ac4d
Коммит
a2e6a5c385
|
@ -763,6 +763,14 @@ export class DuplicateInstallDetected extends DotnetCustomMessageEvent {
|
|||
public readonly eventName = 'DuplicateInstallDetected';
|
||||
}
|
||||
|
||||
export class EmptyDirectoryToWipe extends DotnetCustomMessageEvent {
|
||||
public readonly eventName = 'EmptyDirectoryToWipe';
|
||||
}
|
||||
|
||||
export class FileToWipe extends DotnetCustomMessageEvent {
|
||||
public readonly eventName = 'FileToWipe';
|
||||
}
|
||||
|
||||
export class TriedToExitMasterSudoProcess extends DotnetCustomMessageEvent {
|
||||
public readonly eventName = 'TriedToExitMasterSudoProcess';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ import { DotnetCommandFallbackArchitectureEvent,
|
|||
DotnetLockAttemptingAcquireEvent,
|
||||
DotnetLockErrorEvent,
|
||||
DotnetLockReleasedEvent,
|
||||
EmptyDirectoryToWipe,
|
||||
FileToWipe,
|
||||
SuppressedAcquisitionError
|
||||
} from '../EventStream/EventStreamEvents';
|
||||
|
||||
|
@ -105,6 +107,7 @@ export class FileUtilities extends IFileUtilities
|
|||
{
|
||||
if(!fs.existsSync(directoryToWipe))
|
||||
{
|
||||
eventStream?.post(new EmptyDirectoryToWipe(`The directory ${directoryToWipe} did not exist, so it was not wiped.`))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -113,6 +116,7 @@ export class FileUtilities extends IFileUtilities
|
|||
{
|
||||
try
|
||||
{
|
||||
eventStream?.post(new FileToWipe(`The file ${f} is being deleted.`))
|
||||
if(!fileExtensionsToDelete || path.extname(f).toLocaleLowerCase() in fileExtensionsToDelete)
|
||||
fs.rmSync(path.join(directoryToWipe, f));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче