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
|
||||
mkdir ./build/win-x64/lite
|
||||
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 -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
|
||||
dotnet publish ./src/dot.csproj -f net7.0-windows -c Release -r win-x64 --sc -p:"PublishSingleFile=true" -o ./build/win-x64
|
||||
dotnet publish ./src/dot.csproj -f net7.0 -c Release -r linux-x64 --sc -p:"PublishSingleFile=true" -o ./build/linux-x64
|
||||
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)
|
||||
{
|
||||
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" };
|
||||
var excludeRegexes = Opt.ExcludeRegexes.Select(x => new Regex(x));
|
||||
var fileList = Directory.EnumerateFiles(path, searchPattern
|
||||
|
@ -1,3 +1,4 @@
|
||||
using System.Text;
|
||||
using Dot;
|
||||
using Dot.Git;
|
||||
|
||||
@ -25,40 +26,5 @@ app.Configure(config => {
|
||||
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);
|
||||
var types = LoadVerbs();
|
||||
|
||||
try {
|
||||
await Parser.Default.ParseArguments(args, types).WithParsedAsync(Run);
|
||||
}
|
||||
catch (ArgumentException ex) {
|
||||
AnsiConsole.MarkupLine($"[red]{ex.Message}[/]");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;*/
|
||||
return app.Run(args);
|
Loading…
x
Reference in New Issue
Block a user