Skip to content

Commit

Permalink
[Chore] 如带参数不向下运行,用于可执行检查
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Apr 7, 2024
1 parent 89963c3 commit a31865c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/Lagrange.OneBot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: upload
destination-dir: ./lagrange/
destination-dir: ./lagrange/0.0.3/

- name: Prepare release files
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions Lagrange.OneBot/Lagrange.OneBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="1.6.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions Lagrange.OneBot/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System.Reflection;
using System.Runtime;
using System.Text;
using System.CommandLine;
using System.CommandLine.Invocation;
using Microsoft.Extensions.Hosting;


namespace Lagrange.OneBot;

internal abstract class Program
Expand All @@ -14,6 +17,13 @@ public static void Main(string[] args)

GCSettings.LatencyMode = GCLatencyMode.Batch;

var rootCommand = new RootCommand();
rootCommand.Invoke(args);

if (args.Length > 0) {
Environment.Exit(0);
}

if (!File.Exists("appsettings.json"))
{
Console.WriteLine("No exist config file, create it now...");
Expand Down

0 comments on commit a31865c

Please sign in to comment.