Skip to content

Commit

Permalink
Fix: Custom root folders are just added to exting root folders when s…
Browse files Browse the repository at this point in the history
…et. (#588)
  • Loading branch information
KevinJump authored Feb 20, 2024
1 parent 6134c11 commit 4718cf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 1 addition & 4 deletions uSync.BackOffice/Configuration/uSyncSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ public class uSyncSettings
/// collection of folders uSync looks in when performing imports.
/// </summary>
[DefaultValue("uSync/Root/, uSync/v9")]
public string[] Folders { get; set; } = [
"uSync/Root/",
"uSync/v9/"
];
public string[] Folders { get; set; } = [ ];

/// <summary>
/// Sets this site to be the root site (so it will save into "uSync/root/")
Expand Down
8 changes: 8 additions & 0 deletions uSync.BackOffice/uSyncBackOfficeBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ public static IUmbracoBuilder AdduSync(this IUmbracoBuilder builder, Action<uSyn

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

_ = builder.Services.PostConfigure<uSyncSettings>(options =>
{
if (options.Folders == null || options.Folders.Length == 0)
{
options.Folders = ["uSync/Root/", "uSync/v9/"];
}
});

return builder;
}

Expand Down

0 comments on commit 4718cf5

Please sign in to comment.