Skip to content

Commit

Permalink
fix: rmdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjozork committed Apr 22, 2024
1 parent e14aee1 commit 212a18f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/renderer/utils/Directories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ export class Directories {

console.log('[CLEANUP] Removing', fullPath);
try {
// TODO see if this is equivalent (vite)
fs.rmSync(fullPath);
fs.rmSync(fullPath, { recursive: true });
console.log('[CLEANUP] Removed', fullPath);
} catch (e) {
console.error('[CLEANUP] Could not remove', fullPath, e);
Expand All @@ -129,22 +128,11 @@ export class Directories {

if (fs.existsSync(altDir)) {
console.log('Removing alternative', altDir);
// TODO see if this is equivalent (vite)
fs.rmSync(altDir);
fs.rmSync(altDir, { recursive: true });
}
});
}

static removeTargetForAddon(addon: Addon): void {
const dir = Directories.inInstallLocation(addon.targetDirectory);

if (fs.existsSync(dir)) {
console.log('Removing', dir);
// TODO see if this is equivalent (vite)
fs.rmSync(dir);
}
}

static isFragmenterInstall(target: string | Addon): boolean {
const targetDir = typeof target === 'string' ? target : Directories.inInstallLocation(target.targetDirectory);

Expand Down

0 comments on commit 212a18f

Please sign in to comment.