Skip to content

Commit 048717e

Browse files
committed
🐛 fix backup before install mod again
1 parent 7d39495 commit 048717e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

StarModsManager.sln.DotSettings.user

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@
162162
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATypedBinding_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F5d355ff79c659ca994d9465a32c86c5f42d84debc2e38c560bde64e79fbb44_003FTypedBinding_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
163163
<s:String
164164
x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUpdateKey_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F1cb6e8f1d696afbaa7597a68fcdce63267a9ef7c87e5cfff1c851e36ec8502f_003FUpdateKey_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
165+
<s:String
166+
x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVersion_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fe2a884fc9ca8537885d3c13b86387ec99428fc9c70b49fe548a2c43be866546_003FVersion_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
165167
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AWindowBase_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe6b66c6b133847f9a2c8b591fb074f9d100400_003Fc7_003F97e5e7d8_003FWindowBase_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
166168
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AWindowNotificationManager_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F0ceaca09f3944680b668dee8e1e0370b100a00_003F88_003F558818ea_003FWindowNotificationManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
167169
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AZipFileExtensions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F31013780b37b4a358e189c7ce989fb09d930_003Fdb_003F17359d9b_003FZipFileExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

src/StarModsManager/Api/SMAPI/SmapiModInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private static void MoveDirectory(string sourceDir, string destDir)
232232
private void HandleExistingMod(string dir)
233233
{
234234
Log.Information("Mod already exists: {Dir}", dir);
235-
if (_context.DestDirParent != null) dir.CreateZipBackup(_context.DestDirParent);
235+
dir.CreateZipBackup(_context.ModFolderName);
236236

237237
BackupConfigFile();
238238
BackupI18NFolder();

src/StarModsManager/Api/SMMHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static void CreateZipBackup(this string directoryPath, string zipFileName
156156
}
157157

158158
var isSame = Directory.GetFiles(backupPath)
159-
.Where(x => x.Contains(zipFileName))
159+
.Where(x => x.Contains(zipFileName) && x != zipFilePath)
160160
.Any(x => IsFileSame(x, zipFilePath));
161161
if (isSame) File.Delete(zipFilePath);
162162
}

0 commit comments

Comments
 (0)