File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
using Spectre . Console ;
2
2
using Spectre . Console . Cli ;
3
+ using System . Reflection ;
3
4
using UniFiSharp . CLI . Commands ;
4
5
5
6
namespace UniFiSharp . CLI
6
7
{
7
8
internal class Program
8
9
{
9
- private static string Version => "v1.5.1" ;
10
10
internal static bool Quiet { get ; private set ; } = false ;
11
11
internal static CommandApp App { get ; private set ; } = new CommandApp ( ) ;
12
12
static void Main ( string [ ] args )
13
13
{
14
14
Console . WriteLine ( ) ;
15
15
16
+ var version = Assembly . GetAssembly ( typeof ( UniFiApi ) ) ? . GetName ( ) ? . Version ? . ToString ( 3 ) ;
17
+ if ( version == null )
18
+ {
19
+ AnsiConsole . MarkupLine ( "[red bold]CRITICAL: UniFiSharp library not loaded properly.[/]" ) ;
20
+ return ;
21
+ }
22
+
16
23
if ( ! args . Any ( a => a == "-q" || a == "--quiet" ) )
17
- DrawUniFiSharpLogo ( ) ;
24
+ DrawUniFiSharpLogo ( version ) ;
18
25
else Quiet = true ;
19
26
20
27
App . Configure ( config =>
@@ -177,7 +184,7 @@ static void Main(string[] args)
177
184
Console . WriteLine ( ) ;
178
185
}
179
186
180
- private static void DrawUniFiSharpLogo ( )
187
+ private static void DrawUniFiSharpLogo ( string version )
181
188
{
182
189
var c1 = "[blue]" ;
183
190
var c2 = "[#666666]" ;
@@ -188,7 +195,7 @@ private static void DrawUniFiSharpLogo()
188
195
189
196
AnsiConsole . Write ( new Rule ( ) . RuleStyle ( "blue dim" ) ) ;
190
197
AnsiConsole . MarkupLine ( $ "{ c1 } __ { e } { c3 } __ { e } { c1 } __ __{ e } ") ;
191
- AnsiConsole . MarkupLine ( $ "{ c1 } | |{ e } { c3 } | |{ e } { c1 } _/ // /_{ e } \t { c1 } UniFi Command Line Tool{ e } { v } { Version } { e } ") ;
198
+ AnsiConsole . MarkupLine ( $ "{ c1 } | |{ e } { c3 } | |{ e } { c1 } _/ // /_{ e } \t { c1 } UniFi Command Line Tool{ e } { v } { version } { e } ") ;
192
199
AnsiConsole . MarkupLine ( $ "{ c1 } | |{ e } { c3 } | { e } { c1 } /_ _ __/{ e } \t { l } https://github.com/anthturner/UniFiSharp{ e } ") ;
193
200
AnsiConsole . MarkupLine ( $ "{ c1 } | |{ e } { c3 } | { e } { c1 } /_ _ __/{ e } ") ;
194
201
AnsiConsole . MarkupLine ( $ "{ c1 } | \\ { e } { c2 } --{ e } { c3 } ^-`{ e } { c1 } /_//_/{ e } \t \t { c2 } This tool is not supported or affiliated{ e } ") ;
Original file line number Diff line number Diff line change 3
3
<TargetFramework >netstandard2.1</TargetFramework >
4
4
<PackageId >UniFiSharp</PackageId >
5
5
<GeneratePackageOnBuild >true</GeneratePackageOnBuild >
6
- <Version >1.5.1 </Version >
6
+ <Version >1.5.2 </Version >
7
7
<Authors >Anthony Turner</Authors >
8
8
<Company >Anthony Turner</Company >
9
9
<Description >UniFiSharp provides a cross-platform (NETStandard) interface to control and monitor Ubiquiti UniFi networking components via the UniFi controller software.</Description >
12
12
<RepositoryUrl >https://github.com/anthturner/UniFiSharp</RepositoryUrl >
13
13
<RepositoryType >GitHub</RepositoryType >
14
14
<PackageTags >unifi ubiquiti ubnt</PackageTags >
15
- <AssemblyVersion >1.5.1 .0</AssemblyVersion >
16
- <FileVersion >1.5.1 .0</FileVersion >
15
+ <AssemblyVersion >1.5.2 .0</AssemblyVersion >
16
+ <FileVersion >1.5.2 .0</FileVersion >
17
17
<PackageLicenseFile >LICENSE</PackageLicenseFile >
18
18
<PackageIcon >UniFiSharpLogo.png</PackageIcon >
19
19
<ApplicationIcon >UniFiSharpLogo.ico</ApplicationIcon >
You can’t perform that action at this time.
0 commit comments