Skip to content

Commit

Permalink
Missing folder integrity check when backing up old settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Snow1226 committed Jul 24, 2021
1 parent 827daa6 commit cc5db1b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CameraPlus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v6.0.1 Changes
- Missing folder integrity check when backing up old settings.

# v6.0.0 Changes
- Supports game version 1.16.3.
- Change the configuration file from ini and cfg to json file.
Expand Down
5 changes: 4 additions & 1 deletion CameraPlus/CameraPlusController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ private void Awake()
instance = this;

string path = Path.Combine(UnityGame.UserDataPath, $"{Plugin.Name}.ini");
string backupPath = backupPath = Path.Combine(UnityGame.UserDataPath, Plugin.Name, "OldProfiles");
if (File.Exists(path))
{
RootConfig rootConfig = new RootConfig(path);
File.Copy(path, Path.Combine(UnityGame.UserDataPath, Plugin.Name, "OldProfiles", $"{Plugin.Name}.ini"));
if (!File.Exists(backupPath))
Directory.CreateDirectory(backupPath);
File.Copy(path, Path.Combine(backupPath, $"{Plugin.Name}.ini"), true);
File.Delete(path);
}

Expand Down
4 changes: 2 additions & 2 deletions CameraPlus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0")]
[assembly: AssemblyFileVersion("6.0.0")]
[assembly: AssemblyVersion("6.0.1")]
[assembly: AssemblyFileVersion("6.0.1")]
7 changes: 5 additions & 2 deletions CameraPlus/Utilities/ConfigConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ internal static void ProfileConverter()
$"{fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length)}.json"));
}
Logger.log.Notice($"Profile Convert : {dirInfo.Name}");
CameraUtilities.DirectoryCopy(dirInfo.FullName, Path.Combine(backupPath, dirInfo.Name), true);
DirecrtoryDelete(dirInfo.FullName);
if (!Directory.Exists(Path.Combine(backupPath, dirInfo.Name)))
{
CameraUtilities.DirectoryCopy(dirInfo.FullName, Path.Combine(backupPath, dirInfo.Name), true);
DirecrtoryDelete(dirInfo.FullName);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion CameraPlus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "CameraPlus",
"name": "CameraPlus",
"author": "Various Modders",
"version": "6.0.0",
"version": "6.0.1",
"description": "CameraPlus is a Beat Saber mod that allows for multiple wide FOV cameras with smoothed movement.",
"gameVersion": "1.16.2",
"dependsOn": {
Expand Down

0 comments on commit cc5db1b

Please sign in to comment.