File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ public void Execute(CommandContext context)
3939 userName ,
4040 Convert . ToBase64String ( TeaHelper . Encrypt ( Encoding . UTF8 . GetBytes ( pwd ) , context . EncryptKey ) ) ) ;
4141
42+ var path = Path . GetDirectoryName ( context . AppConfigFilePath ) ;
43+ if ( ! Directory . Exists ( path ) )
44+ {
45+ Directory . CreateDirectory ( path ! ) ;
46+ }
47+
4248 File . WriteAllText ( context . AppConfigFilePath , JsonConvert . SerializeObject ( config ) ) ;
4349
4450 ConsoleHelper . PrintMsg ( "配置设置成功!" ) ;
Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ static void PrintTitle()
6666 static bool Init ( )
6767 {
6868 var context = new CommandContext ( ) ;
69- context . AppConfigFilePath = Path . Combine ( Path . GetDirectoryName ( typeof ( Program ) . Assembly . Location ) ?? throw new InvalidOperationException ( ) , CfgFileName ) ;
69+
70+ var docPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) ;
71+ context . AppConfigFilePath = Path . Combine ( docPath , "dotnet-cnblog" , CfgFileName ) ;
7072
7173 if ( ! File . Exists ( context . AppConfigFilePath ) )
7274 {
Original file line number Diff line number Diff line change 1515 <Description >Cnblogs Article Quick Publish Tool.</Description >
1616 <Copyright >Copyright 2018-2020 stulzq</Copyright >
1717 <PackageProjectUrl >https://github.com/stulzq/dotnet-cnblogs-tool</PackageProjectUrl >
18- <PackageLicenseUrl >https://github.com/stulzq/dotnet-cnblogs-tool/blob/master/LICENSE </PackageLicenseUrl >
18+ <PackageLicenseUrl ></PackageLicenseUrl >
1919 <PackageTags >cnblogs</PackageTags >
2020 <PackageRequireLicenseAcceptance >true</PackageRequireLicenseAcceptance >
2121 <Version >1.4.0</Version >
2424 <SymbolPackageFormat >snupkg</SymbolPackageFormat >
2525 <RootNamespace >Dotnetcnblog</RootNamespace >
2626 <PackageReleaseNotes >升级到 .NET 5.0 并且重构代码,使用方法有小的变更,请查看文档 https://github.com/stulzq/dotnet-cnblogs-tool</PackageReleaseNotes >
27+ <PackageLicenseFile >LICENSE</PackageLicenseFile >
28+ </PropertyGroup >
29+
30+ <!-- 编译信息 -->
31+ <PropertyGroup Condition =" '$(Configuration)'=='Release'" >
32+ <!-- 单文件 -->
33+ <PublishSingleFile >true</PublishSingleFile >
34+ <!-- 预先部分AOT编译 -->
35+ <!-- <PublishReadyToRun>true</PublishReadyToRun>-->
36+ <!-- 在主动剪裁模式下发布应用,在此模式下,将剪裁程序集中未使用的代码,并启用裁边器警告 -->
37+ <PublishTrimmed >true</PublishTrimmed >
38+ <IsTrimmable >true</IsTrimmable >
39+ <TrimMode >link</TrimMode >
40+ <SuppressTrimAnalysisWarnings >true</SuppressTrimAnalysisWarnings >
2741 </PropertyGroup >
2842
2943 <ItemGroup >
4054 </ItemGroup >
4155
4256
57+ <ItemGroup >
58+ <None Include =" ..\..\LICENSE" >
59+ <Pack >True</Pack >
60+ <PackagePath ></PackagePath >
61+ </None >
62+ </ItemGroup >
63+
64+
4365</Project >
Original file line number Diff line number Diff line change 1+ dotnet publish -r win-x64 -p:PublishSingleFile=true --self-contained true
2+ dotnet publish -r win-x86 -p:PublishSingleFile=true --self-contained true
3+ dotnet publish -r osx-x64 -p:PublishSingleFile=true --self-contained true
4+ dotnet publish -r linux-x64 -p:PublishSingleFile=true --self-contained true
5+ dotnet publish -r linux-arm -p:PublishSingleFile=true --self-contained true
You can’t perform that action at this time.
0 commit comments