using System;
using System.IO;

namespace StellaOps.Excititor.Worker.Options;

public sealed class VexWorkerPluginOptions
{
    public string? Directory { get; set; }

    public string? SearchPattern { get; set; }

    internal string ResolveDirectory()
        => string.IsNullOrWhiteSpace(Directory)
            ? Path.Combine(AppContext.BaseDirectory, "plugins")
            : Path.GetFullPath(Directory);

    internal string ResolveSearchPattern()
        => string.IsNullOrWhiteSpace(SearchPattern)
            ? "StellaOps.Excititor.Connectors.*.dll"
            : SearchPattern!;
}
