Merge pull request #15831 from abpframework/liangshiwei/cli

Fix bundle service path issue
pull/15832/head
maliming 3 years ago committed by GitHub
commit 082519264b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -109,12 +109,19 @@ public abstract class BundlerBase : IBundler, ITransientDependency
content = GetFileContent(filePath, options.Minify); content = GetFileContent(filePath, options.Minify);
} }
content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(options.Directory, "wwwroot"), content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"),
content); content);
if (content.Contains("coding"))
{
}
builder.AppendLine(content); builder.AppendLine(content);
} }
return builder.ToString(); return builder.ToString();
} }
} }
@ -125,15 +132,15 @@ public abstract class BundlerBase : IBundler, ITransientDependency
foreach (var definition in bundleDefinitions) foreach (var definition in bundleDefinitions)
{ {
var filePath = Path.Combine(definition.Source.Split('/')); var filePath = Path.Combine(definition.Source.Split('/'));
var fileFullPath = Directory.GetFiles(options.Directory, string.Empty, SearchOption.AllDirectories).FirstOrDefault(x => x.EndsWith(filePath)); var fileFullPath = Directory.GetFiles(options.Directory, string.Empty, SearchOption.AllDirectories).FirstOrDefault(x => x.EndsWith(filePath));
if(fileFullPath == null) if(fileFullPath == null)
{ {
throw new AbpException("Not found: " + definition.Source); throw new AbpException("Not found: " + definition.Source);
} }
var content = GetFileContent(fileFullPath, options.Minify); var content = GetFileContent(fileFullPath, options.Minify);
content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(options.Directory, "wwwroot"), content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"),
content); content);
builder.AppendLine(content); builder.AppendLine(content);

Loading…
Cancel
Save