Skip to content

Commit e9c0df7

Browse files
committed
- Fixed issue where symlink was being created for original Save dir when symlinks not supported, causing deployment error.
- Fixed issue where undeploy would fail sometimes due to an unclean deployment.
1 parent 31bd875 commit e9c0df7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/electron.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,8 +2620,10 @@ class ElectronLoader {
26202620

26212621
// Create helper symlink for easy access to backed up saves
26222622
const backupDirHelperLink = `${deploySaveDir.replace(/[/\\]$/, "")}.original`;
2623-
if (fs.existsSync(savesBackupDir)) {
2624-
await fs.symlink(path.resolve(savesBackupDir), path.resolve(backupDirHelperLink), "dir");
2623+
if (this.#checkLinkSupported(path.resolve(savesBackupDir), [path.resolve(backupDirHelperLink)], true, "dir")) {
2624+
if (fs.existsSync(savesBackupDir)) {
2625+
await fs.symlink(path.resolve(savesBackupDir), path.resolve(backupDirHelperLink), "dir");
2626+
}
26252627
}
26262628

26272629
return [deploySaveDir, backupDirHelperLink];
@@ -2825,6 +2827,10 @@ class ElectronLoader {
28252827
const backupSrc = path.join(extFilesBackupDir, backupFile);
28262828
const backupDest = path.join(path.dirname(extFilesBackupDir), backupFile);
28272829

2830+
if (fs.existsSync(backupDest)) {
2831+
fs.removeSync(backupDest);
2832+
}
2833+
28282834
// Use hardlinks for faster file restoration in link mode
28292835
if (profile.modLinkMode && !fs.lstatSync(backupSrc).isDirectory()) {
28302836
// TODO - Recursively do this when encountering directories

0 commit comments

Comments
 (0)