mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Add status support
This commit is contained in:

committed by
Patrik Svensson

parent
cbed41e637
commit
501db5d287
@ -19,4 +19,4 @@ if(!$?) {
|
||||
Pop-Location
|
||||
|
||||
# Copy the files to the correct location
|
||||
Copy-Item (Join-Path "$Output" "ProgressSpinner.Generated.cs") -Destination "$Source/Progress/ProgressSpinner.Generated.cs"
|
||||
Copy-Item (Join-Path "$Output" "Spinner.Generated.cs") -Destination "$Source/Progress/Spinner.Generated.cs"
|
||||
|
@ -21,8 +21,8 @@ namespace Generator.Commands
|
||||
{
|
||||
// Read the spinner model.
|
||||
var spinners = new List<Spinner>();
|
||||
spinners.AddRange(Spinner.Parse(File.ReadAllText("Data/spinners.json")));
|
||||
spinners.AddRange(Spinner.Parse(File.ReadAllText("Data/spinners_default.json")));
|
||||
spinners.AddRange(Spinner.Parse(File.ReadAllText("Data/spinners_sindresorhus.json")));
|
||||
|
||||
var output = new DirectoryPath(settings.Output);
|
||||
if (!_fileSystem.Directory.Exists(settings.Output))
|
||||
@ -31,7 +31,7 @@ namespace Generator.Commands
|
||||
}
|
||||
|
||||
// Parse the Scriban template.
|
||||
var templatePath = new FilePath("Templates/ProgressSpinner.Generated.template");
|
||||
var templatePath = new FilePath("Templates/Spinner.Generated.template");
|
||||
var template = Template.Parse(File.ReadAllText(templatePath.FullPath));
|
||||
|
||||
// Render the template with the model.
|
||||
|
@ -15,7 +15,10 @@
|
||||
<None Update="Data\colors.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Data\spinners.json">
|
||||
<None Update="Data\spinners_default.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Data\spinners_sindresorhus.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Templates\ColorTable.Generated.template">
|
||||
@ -27,7 +30,7 @@
|
||||
<None Update="Templates\ColorPalette.Generated.template">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Templates\ProgressSpinner.Generated.template">
|
||||
<None Update="Templates\Spinner.Generated.template">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Templates\Emoji.Json.template">
|
||||
|
@ -2,7 +2,6 @@
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Generated {{ date.now | date.to_string `%F %R` }}
|
||||
// Generated from https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
|
@ -3,6 +3,9 @@
|
||||
// This code was generated by a tool.
|
||||
// Generated {{ date.now | date.to_string `%F %R` }}
|
||||
//
|
||||
// Partly generated from
|
||||
// https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
@ -13,10 +16,10 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Spectre.Console
|
||||
{
|
||||
public abstract partial class ProgressSpinner
|
||||
public abstract partial class Spinner
|
||||
{
|
||||
{{~ for spinner in spinners ~}}
|
||||
private sealed class {{ spinner.normalized_name }}Spinner : ProgressSpinner
|
||||
private sealed class {{ spinner.normalized_name }}Spinner : Spinner
|
||||
{
|
||||
public override TimeSpan Interval => TimeSpan.FromMilliseconds({{ spinner.interval }});
|
||||
public override bool IsUnicode => {{ spinner.unicode }};
|
||||
@ -38,7 +41,7 @@ namespace Spectre.Console
|
||||
/// <summary>
|
||||
/// Gets the "{{ spinner.name }}" spinner.
|
||||
/// </summary>
|
||||
public static ProgressSpinner {{ spinner.normalized_name }} { get; } = new {{ spinner.normalized_name }}Spinner();
|
||||
public static Spinner {{ spinner.normalized_name }} { get; } = new {{ spinner.normalized_name }}Spinner();
|
||||
{{~ end ~}}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user