Skip to content

Commit e097ed0

Browse files
committed
Feat: foundation for DownloadIcon command
1 parent 47a5b90 commit e097ed0

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// ---------------------------------------------------------------------------------------------------------------------
2+
// Imports
3+
// ---------------------------------------------------------------------------------------------------------------------
4+
using CliArgsParser;
5+
using static CodeOfChaos.Ansi.AnsiColor;
6+
7+
namespace CodeOfChaos.CliArgsParser.Library.CommandAtlases;
8+
9+
// ---------------------------------------------------------------------------------------------------------------------
10+
// Code
11+
// ---------------------------------------------------------------------------------------------------------------------
12+
public class DownloadIconAtlas : ICommandAtlas {
13+
[Command<DownloadIconParameters>("download-icon")]
14+
public async Task DownloadIcon(DownloadIconParameters parameters) {
15+
// Todo use new CodeOfChaos.Ansi markup
16+
Console.WriteLine(Fore("orange", "Starting execution 'VersionBump' "));
17+
18+
// Todo create a downloader for the icon.png assets uses for nuget packages
19+
}
20+
21+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ---------------------------------------------------------------------------------------------------------------------
2+
// Imports
3+
// ---------------------------------------------------------------------------------------------------------------------
4+
using CliArgsParser;
5+
6+
namespace CodeOfChaos.CliArgsParser.Library.CommandAtlases;
7+
8+
// ---------------------------------------------------------------------------------------------------------------------
9+
// Code
10+
// ---------------------------------------------------------------------------------------------------------------------
11+
public class DownloadIconParameters : ICommandParameters {
12+
[ArgValue("root", "r")] [Description("The root directory of the solution")]
13+
public string Root { get; set; } = "../../../../../";
14+
15+
[ArgValue("destination", "d")] [Description("The destination folder to download the icons to")]
16+
public string Destination { get; set; } = "assets/icon.png";
17+
18+
[ArgValue("origin", "o")] [Description("The icon to download")]
19+
public string? Origin { get; set; }
20+
21+
[ArgValue("projects", "p")] [Description("The projects to update")]
22+
public string? ProjectsStringValue { get; set; }
23+
24+
[ArgValue("project-split", "ps")] [Description("The split character to use when splitting the projects string")]
25+
public string ProjectsSplit { get; set; } = ";";
26+
27+
private string[]? _projects;
28+
public string[] Projects => _projects ??= ProjectsStringValue?
29+
.Split(ProjectsSplit)
30+
.Where(entry => !string.IsNullOrWhiteSpace(entry))
31+
.ToArray()
32+
?? [];
33+
}

0 commit comments

Comments
 (0)