Skip to content

Commit add2a18

Browse files
committed
Fix: Custom root folders are just added to exting root folders when set. (#588)
1 parent 5b727bc commit add2a18

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

uSync.BackOffice/Configuration/uSyncSettings.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ public class uSyncSettings
1818
/// <summary>
1919
/// collection of folders uSync looks in when performing imports.
2020
/// </summary>
21-
[DefaultValue("uSync/Root/, uSync/v14")]
22-
public string[] Folders { get; set; } = [
23-
"uSync/Root/",
24-
"uSync/v14/"
25-
];
21+
[DefaultValue("uSync/Root/, uSync/v14/")]
22+
public string[] Folders { get; set; } = [ ];
2623

2724
/// <summary>
2825
/// folder that has old things in.

uSync.BackOffice/uSyncBackOfficeBuilderExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ public static IUmbracoBuilder AdduSync(this IUmbracoBuilder builder, Action<uSyn
9090

9191
builder.Services.AddTransient<ISyncActionService, SyncActionService>();
9292

93+
_ = builder.Services.PostConfigure<uSyncSettings>(options =>
94+
{
95+
if (options.Folders == null || options.Folders.Length == 0)
96+
{
97+
options.Folders = ["uSync/Root/", "uSync/v14/"];
98+
}
99+
});
100+
93101
return builder;
94102
}
95103

0 commit comments

Comments
 (0)