Skip to content

Commit 0821658

Browse files
committed
Update Show method in the AppBundleInfo extension.
1 parent ac1eec9 commit 0821658

File tree

6 files changed

+18
-30
lines changed

6 files changed

+18
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [1.0.3] / 2025-07-31
88
### Updates
99
- Fix local bundle information when install.
10+
- Update `Show` method in the `AppBundleInfo` extension.
1011

1112
## [1.0.2] / 2025-07-30
1213
### Features

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.0.3-alpha</Version>
3+
<Version>1.0.3-beta</Version>
44
</PropertyGroup>
55
</Project>

ricaun.AppBundleTool/AppBundle/AppBundleInfoExtension.cs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,17 @@ namespace ricaun.AppBundleTool.AppBundle
88
{
99
internal static class AppBundleInfoExtension
1010
{
11-
[Obsolete("Use the AppBundleInfo?.ToDataTable().Print()")]
12-
public static void Show(this AppBundleInfo appBundleInfo, bool showComponents = false)
11+
public static void Show(this AppBundleInfo[] appBundleInfoArray, bool detail = false)
1312
{
14-
if (appBundleInfo is null) return;
15-
Console.WriteLine($"Name: \t{appBundleInfo.Name}");
16-
Console.WriteLine($"Path: \t{appBundleInfo.PathBundle}");
17-
Console.WriteLine($"App: \t{appBundleInfo.ApplicationPackage.AsString()}");
13+
appBundleInfoArray.ToDataTable(detail).Print();
14+
}
1815

19-
if (showComponents == false) return;
20-
if (appBundleInfo.ApplicationPackage is not null)
16+
public static void Show(this AppBundleInfo appBundleInfo, bool detail = false)
17+
{
18+
if (appBundleInfo is null) return;
19+
foreach (var table in appBundleInfo.ToDataTables(detail))
2120
{
22-
foreach (var component in appBundleInfo.ApplicationPackage.Components)
23-
{
24-
foreach (var componentEntry in component.ComponentEntry)
25-
{
26-
Console.WriteLine($" ComponentEntry: {component.RuntimeRequirements.Platform} {component.RuntimeRequirements.SeriesMin} {component.RuntimeRequirements.SeriesMax} \t{componentEntry.AppName} \t{componentEntry.ModuleName}");
27-
}
28-
}
21+
table?.Print();
2922
}
3023
}
3124

ricaun.AppBundleTool/Program.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ private static void ExecuteCommand(Options options)
7575
}
7676
Console.WriteLine(installMessage);
7777
}
78-
AppBundleUtils.FindAppBundleByAppName(appBundleName)?.ToDataTable().Print();
78+
var appBundleInfo = AppBundleUtils.FindAppBundleByAppName(appBundleName);
79+
appBundleInfo.Show(Verbosity);
7980
}
8081
else if (options.Uninstall)
8182
{
@@ -124,10 +125,7 @@ private static void ExecuteCommand(Options options)
124125
Console.WriteLine($"AppBundle '{appBundleName}' not found.".ToConsoleRed());
125126
return;
126127
}
127-
foreach (var table in appBundleInfo.ToDataTables(Verbosity))
128-
{
129-
table.Print();
130-
}
128+
appBundleInfo.Show(Verbosity);
131129
}
132130
else
133131
{
@@ -137,18 +135,15 @@ private static void ExecuteCommand(Options options)
137135
}
138136
else
139137
{
140-
var appBundle = AppBundleUtils.FindAppBundle(appBundleName);
141-
if (appBundle is null)
138+
var appBundleInfo = AppBundleUtils.FindAppBundle(appBundleName);
139+
if (appBundleInfo is null)
142140
{
143141
Show();
144142
Console.WriteLine($"AppBundle '{appBundleName}' not found.".ToConsoleYellow());
145143
return;
146144
}
147145

148-
foreach (var table in appBundle.ToDataTables(Verbosity))
149-
{
150-
table.Print();
151-
}
146+
appBundleInfo.Show(Verbosity);
152147
}
153148
}
154149
else
@@ -215,7 +210,7 @@ public static void WriteLine(object message)
215210
public static void Show()
216211
{
217212
var appBundles = AppBundleUtils.GetAppBundles();
218-
appBundles.ToDataTable(Verbosity).Print();
213+
appBundles.Show(Verbosity);
219214
}
220215

221216
private static string DisplayHelp<T>(ParserResult<T> result)

ricaun.AppBundleTool/Utils/ConsoleColorExtension.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public static string ToConsoleGrey(this object value)
8888
{
8989
return $"{GREY}{value}{NORMAL}";
9090
}
91-
9291

9392
static string NORMAL => Console.IsOutputRedirected ? "" : "\x1b[39m";
9493
static string RED => Console.IsOutputRedirected ? "" : "\x1b[91m";

ricaun.AppBundleTool/dotnet/dotnet-install-tool.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ AppBundleTool -a https://github.com/ricaun-io/RevitAddin.CommandLoader/releases/
77
AppBundleTool -a https://github.com/ricaun-io/RevitAddin.CommandLoader/releases/latest/download/RevitAddin.CommandLoader.bundle.zip -i
88
AppBundleTool -a RevitAddin.CommandLoader.bundle -u
99
AppBundleTool -a RevitAddin.CommandLoader
10-
AppBundleTool -a https://github.com/ricaun-io/RevitAddin.CommandLoader/releases/latest/download/RevitAddin.CommandLoader.bundle.zip -i
10+
AppBundleTool -a https://github.com/ricaun-io/RevitAddin.CommandLoader/releases/latest/download/RevitAddin.CommandLoader.bundle.zip -i -v
1111
timeout 10

0 commit comments

Comments
 (0)