Skip to content

Commit

Permalink
Fix a sync problem when bundle concat/minify is disabled, content if …
Browse files Browse the repository at this point in the history
…newer would not be copied
  • Loading branch information
xoofx committed Aug 30, 2023
1 parent aebfb6b commit dcb0453
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/Lunet.Bundles/BundleProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ private void ProcessBundleLinks(BundleObject bundle, Dictionary<UPath, ContentOb
{
Site.Warning($"Minify is setup for bundle [{bundle.Name}] but no minifiers are registered (Minified requested: {minifierName ?? "default"})");
}
}

}

bool bundleAsIs = !bundle.Minify && !bundle.Concat;

// Process links
for (int i = 0; i < bundle.Links.Count; i++)
{
Expand Down Expand Up @@ -189,23 +191,32 @@ private void ProcessBundleLinks(BundleObject bundle, Dictionary<UPath, ContentOb
link.Url = url;
}


FileSystemItem entry = default;

// Process file by existing processors
if (currentContent == null)
{
// Check first site, then meta
entry = new FileSystemItem(Site.FileSystem, path, false);
var fs = Site.FileSystem;
entry = new FileSystemItem(fs, path, false);
bool exists = entry.Exists();
if (!exists)
{
fs = Site.MetaFileSystem;
entry = new FileSystemItem(Site.MetaFileSystem, path, false);
exists = entry.Exists();
}

if (exists)
{
// Fetch the datetime of the content if we don't process it for concat/minify
if (bundleAsIs)
{
entry.CreationTime = fs.GetCreationTime(path);
entry.LastAccessTime = fs.GetLastAccessTime(path);
entry.LastWriteTime = fs.GetLastWriteTime(path);
}

currentContent = new FileContentObject(Site, entry);
}
else
Expand Down

0 comments on commit dcb0453

Please sign in to comment.