Skip to content

Commit

Permalink
Todo sync now handles priorty correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rprouse committed Oct 28, 2024
1 parent d67b840 commit b4cef95
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Guppi.Console/Guppi.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageProjectUrl>https://github.com/rprouse/guppi</PackageProjectUrl>
<RepositoryUrl>https://github.com/rprouse/guppi</RepositoryUrl>
<PackageId>dotnet-guppi</PackageId>
<Version>6.3.1</Version>
<Version>6.3.2</Version>
<PackAsTool>true</PackAsTool>
<ToolCommandName>guppi</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Guppi.Console/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Guppi.Console": {
"commandName": "Project",
"commandLineArgs": "bills all"
"commandLineArgs": "todo sync"
}
}
}
11 changes: 10 additions & 1 deletion Guppi.Core/Services/TodoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ public async Task Sync()
.ToList();
foreach (var task in notLocal)
{
string taskStr = $"{task.Updated.GetRfc3339Date().ToString("yyyy-MM-dd")} {task.Title}";
// Pull the priority out of the title
string priority = string.Empty;
string title = task.Title;
if (title.Length >= 3 && title[0] == '(' && title[2] == ')' && title[3] == ' ')
{
priority = title.Substring(0, 4);
title = title.Substring(3).Trim();
}

string taskStr = $"{priority}{task.Updated.GetRfc3339Date().ToString("yyyy-MM-dd")} {title}";
if (!string.IsNullOrEmpty(task.Due))
{
taskStr += $" due:{task.Due}";
Expand Down

0 comments on commit b4cef95

Please sign in to comment.