Fix file retention after updates on macOS #417
This fixes issue #417 where autoupdate installer files were not deleted on macOS, leading to accumulation of old installers. Key changes: - Store update files in application-specific directory - Clear update files directory on every app launch Other supporting changes: - Refactor file system operations to be more testable and reusable - Improve separation of concerns in directory management - Enhance dependency injection for auto-update logic - Fix async completion to support `await` operations - Add additional logging and revise some log messages during updates
This commit is contained in:
@@ -1,35 +1,17 @@
|
||||
import type {
|
||||
CommandOps,
|
||||
FileSystemOps,
|
||||
OperatingSystemOps,
|
||||
LocationOps,
|
||||
SystemOperations,
|
||||
} from '@/infrastructure/CodeRunner/System/SystemOperations';
|
||||
import type { FileSystemOperations } from '@/infrastructure/FileSystem/FileSystemOperations';
|
||||
import { CommandOpsStub } from './CommandOpsStub';
|
||||
import { FileSystemOpsStub } from './FileSystemOpsStub';
|
||||
import { LocationOpsStub } from './LocationOpsStub';
|
||||
import { OperatingSystemOpsStub } from './OperatingSystemOpsStub';
|
||||
import { FileSystemOperationsStub } from './FileSystemOperationsStub';
|
||||
|
||||
export class SystemOperationsStub implements SystemOperations {
|
||||
public operatingSystem: OperatingSystemOps = new OperatingSystemOpsStub();
|
||||
|
||||
public location: LocationOps = new LocationOpsStub();
|
||||
|
||||
public fileSystem: FileSystemOps = new FileSystemOpsStub();
|
||||
public fileSystem: FileSystemOperations = new FileSystemOperationsStub();
|
||||
|
||||
public command: CommandOps = new CommandOpsStub();
|
||||
|
||||
public withOperatingSystem(operatingSystemOps: OperatingSystemOps): this {
|
||||
this.operatingSystem = operatingSystemOps;
|
||||
return this;
|
||||
}
|
||||
|
||||
public withLocation(location: LocationOps): this {
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
public withFileSystem(fileSystem: FileSystemOps): this {
|
||||
public withFileSystem(fileSystem: FileSystemOperations): this {
|
||||
this.fileSystem = fileSystem;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user