mirror of
https://github.com/nsnail/dot.git
synced 2025-06-17 21:13:21 +08:00
<fix>
This commit is contained in:
parent
14d72106cd
commit
1c66b36e34
@ -1,6 +1,4 @@
|
|||||||
dotnet build
|
dotnet build
|
||||||
mkdir ./build/win-x64/lite
|
dotnet publish ./src/dot.csproj -f net7.0-windows -c Release -r win-x64 --sc -p:"PublishSingleFile=true" -o ./build/win-x64
|
||||||
dotnet publish -f net7.0 -c Release -r win-x64 --sc -p:"PublishSingleFile=true" -p:"PublishTrimmed=true" -p:"UseSystemResourceKeys=true" -o ./build/win-x64/lite
|
dotnet publish ./src/dot.csproj -f net7.0 -c Release -r linux-x64 --sc -p:"PublishSingleFile=true" -o ./build/linux-x64
|
||||||
dotnet publish -f net7.0-windows -c Release -r win-x64 --sc -p:"PublishSingleFile=true" -o ./build/win-x64/full
|
|
||||||
dotnet publish -f net7.0 -c Release -r linux-x64 --sc -p:"PublishSingleFile=true" -o ./build/linux-x64
|
|
||||||
Remove-Item -r ./build/temp
|
Remove-Item -r ./build/temp
|
@ -19,7 +19,7 @@ public abstract class FilesTool<TOption> : ToolBase<TOption> where TOption : Dir
|
|||||||
private string[] EnumerateFiles(string path, string searchPattern, out int excludeCnt)
|
private string[] EnumerateFiles(string path, string searchPattern, out int excludeCnt)
|
||||||
{
|
{
|
||||||
var exCnt = 0;
|
var exCnt = 0;
|
||||||
if (!Opt.ExcludeRegexes.Any()) //默认排除.git 、 node_modules 目录
|
if (Opt.ExcludeRegexes?.FirstOrDefault() is null) //默认排除.git 、 node_modules 目录
|
||||||
Opt.ExcludeRegexes = new[] { @"\.git", "node_modules" };
|
Opt.ExcludeRegexes = new[] { @"\.git", "node_modules" };
|
||||||
var excludeRegexes = Opt.ExcludeRegexes.Select(x => new Regex(x));
|
var excludeRegexes = Opt.ExcludeRegexes.Select(x => new Regex(x));
|
||||||
var fileList = Directory.EnumerateFiles(path, searchPattern
|
var fileList = Directory.EnumerateFiles(path, searchPattern
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
using System.Text;
|
||||||
using Dot;
|
using Dot;
|
||||||
using Dot.Git;
|
using Dot.Git;
|
||||||
|
|
||||||
@ -25,40 +26,5 @@ app.Configure(config => {
|
|||||||
config.ValidateExamples();
|
config.ValidateExamples();
|
||||||
});
|
});
|
||||||
|
|
||||||
return app.Run(args);
|
|
||||||
|
|
||||||
|
|
||||||
/*using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using Dot;
|
|
||||||
|
|
||||||
Type[] LoadVerbs()
|
|
||||||
{
|
|
||||||
return typeof(Program).Assembly.GetTypes()
|
|
||||||
//
|
|
||||||
.Where(x => x.GetCustomAttribute<VerbAttribute>() is not null)
|
|
||||||
.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async Task Run(object args)
|
|
||||||
{
|
|
||||||
if (args is not OptionBase option) return;
|
|
||||||
var tool = ToolsFactory.Create(option);
|
|
||||||
await tool.Run();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Entry Point
|
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
var types = LoadVerbs();
|
return app.Run(args);
|
||||||
|
|
||||||
try {
|
|
||||||
await Parser.Default.ParseArguments(args, types).WithParsedAsync(Run);
|
|
||||||
}
|
|
||||||
catch (ArgumentException ex) {
|
|
||||||
AnsiConsole.MarkupLine($"[red]{ex.Message}[/]");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;*/
|
|
Loading…
x
Reference in New Issue
Block a user