Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] use deleteFolder instead of deleteFile for linked folder paths #812

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/services/folder-linker.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InstallationLocationService } from "./installation-location.service";
import log from "electron-log";
import { deleteFile, deleteFileSync, deleteFolder, deleteFolderSync, ensureFolderExist, moveFolderContent, pathExist } from "../helpers/fs.helpers";
import { deleteFileSync, deleteFolder, deleteFolderSync, ensureFolderExist, moveFolderContent, pathExist } from "../helpers/fs.helpers";
import { lstat, symlink } from "fs/promises";
import path from "path";
import { copy, mkdirSync, readlink, symlinkSync } from "fs-extra";
Expand Down Expand Up @@ -113,7 +113,7 @@ export class FolderLinkerService {
if (isTargetedToSharedPath) {
return;
}
await deleteFile(folderPath);
await deleteFolder(folderPath);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf 😅 how could it have worked before 👀 x)


log.info(`Linking ${folderPath} to ${sharedPath}; type: ${this.linkingType}`);
return symlink(sharedPath, folderPath, this.getLinkingType());
Expand Down Expand Up @@ -141,7 +141,7 @@ export class FolderLinkerService {
if (!(await this.isFolderSymlink(folderPath))) {
return;
}
await deleteFile(folderPath);
await deleteFolder(folderPath);

const sharedPath = await this.getSharedFolder(folderPath, options?.intermediateFolder);

Expand Down
Loading