Skip to content

Commit 6fce57a

Browse files
committed
Merge branch 'master' into refactor-search
2 parents 19482c9 + 1f42a9d commit 6fce57a

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>1.0.0</Version>
4+
<Version>1.0.1</Version>
55
<OutputType>Exe</OutputType>
66
<TargetFramework>net9.0</TargetFramework>
77
<ImplicitUsings>enable</ImplicitUsings>

src/tools/BootstrapBlazor.CssBundler/Bundler.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5+
using System.Text;
6+
57
namespace BootstrapBlazor.CssBundler;
68

79
internal class Bundler
@@ -30,8 +32,16 @@ public static void Run(string[] args)
3032

3133
static void BundlerCore(string bundlerFile)
3234
{
33-
var option = BundlerOptions.LoadFromConfigFile(bundlerFile);
35+
var options = BundlerOptions.LoadFromConfigFile(bundlerFile);
36+
37+
foreach (var option in options)
38+
{
39+
DoBundler(bundlerFile, option);
40+
}
41+
}
3442

43+
static void DoBundler(string bundlerFile, BundlerOptions option)
44+
{
3545
if (string.IsNullOrEmpty(option.OutputFileName))
3646
{
3747
return;
@@ -58,7 +68,8 @@ static void BundlerCore(string bundlerFile)
5868
}
5969

6070
using var reader = File.OpenText(inputFile);
61-
reader.BaseStream.CopyTo(writer);
71+
var content = reader.ReadToEnd();
72+
writer.Write(Encoding.UTF8.GetBytes(content));
6273
reader.Close();
6374
}
6475
writer.Close();

src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ sealed class BundlerOptions
1313

1414
public List<string> InputFiles { get; set; } = [];
1515

16-
public static BundlerOptions LoadFromConfigFile(string configFile)
16+
public static List<BundlerOptions> LoadFromConfigFile(string configFile)
1717
{
1818
var json = File.ReadAllText(configFile);
1919

20-
return JsonSerializer.Deserialize<BundlerOptions>(json, JsonSerializerOptions.Web) ?? new();
20+
return JsonSerializer.Deserialize<List<BundlerOptions>>(json, JsonSerializerOptions.Web) ?? new();
2121
}
2222
}

0 commit comments

Comments
 (0)