Skip to content

Commit e9cae26

Browse files
committed
Fixed script preserve on update
1 parent dceb46b commit e9cae26

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

OpenIDE.Core/Configs/ConfigReader.cs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public string[] GetKeys() {
2222
// Get from local profile
2323
var localProfile = _locator.GetActiveLocalProfile();
2424
var path = _locator.GetLocalProfilePath(localProfile);
25+
keys = mergeKeys(path, keys);
2526

2627
// Get from local default profile
2728
if (localProfile != "default") {

OpenIDE.Core/Packaging/Installer.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,15 @@ private void backupDirectoryTo(string source, string destinationRoot) {
359359
Action<string,string> copyAll = (src, dest) => {};
360360
copyAll = (src, dest) => {
361361
foreach (var dir in Directory.GetDirectories(src)) {
362-
var destDir = Path.Combine(dest, Path.GetFileName(source));
362+
var destDir = Path.Combine(dest, Path.GetFileName(dir));
363363
if (!Directory.Exists(destDir))
364364
Directory.CreateDirectory(destDir);
365365
copyAll(dir, destDir);
366366
}
367-
foreach (var file in Directory.GetFiles(source))
368-
File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), true);
367+
foreach (var file in Directory.GetFiles(src)) {
368+
Logger.Write("copying "+Path.Combine(dest, Path.GetFileName(file)));
369+
File.Copy(file, Path.Combine(dest, Path.GetFileName(file)), true);
370+
}
369371
};
370372
copyAll(source, destination);
371373
}

OpenIDE.Core/Profiles/ProfileLocator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private void getFilesRecursive(string path, List<string> files, string pattern)
173173

174174
private string getActiveProfile(string rootPath) {
175175
if (rootPath == null)
176-
return "default";
176+
return null;
177177
var active = Path.Combine(rootPath, "active.profile");
178178
if (File.Exists(active)) {
179179
var name = File.ReadAllText(active)

0 commit comments

Comments
 (0)