Skip to content

Commit 4ba5908

Browse files
authored
Merge pull request #203 from rprouse/issue/194
Todo sync now handles priorty correctly
2 parents d67b840 + b4cef95 commit 4ba5908

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Guppi.Console/Guppi.Console.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageProjectUrl>https://github.com/rprouse/guppi</PackageProjectUrl>
1414
<RepositoryUrl>https://github.com/rprouse/guppi</RepositoryUrl>
1515
<PackageId>dotnet-guppi</PackageId>
16-
<Version>6.3.1</Version>
16+
<Version>6.3.2</Version>
1717
<PackAsTool>true</PackAsTool>
1818
<ToolCommandName>guppi</ToolCommandName>
1919
<PackageOutputPath>./nupkg</PackageOutputPath>

Guppi.Console/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"Guppi.Console": {
44
"commandName": "Project",
5-
"commandLineArgs": "bills all"
5+
"commandLineArgs": "todo sync"
66
}
77
}
88
}

Guppi.Core/Services/TodoService.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ public async Task Sync()
9595
.ToList();
9696
foreach (var task in notLocal)
9797
{
98-
string taskStr = $"{task.Updated.GetRfc3339Date().ToString("yyyy-MM-dd")} {task.Title}";
98+
// Pull the priority out of the title
99+
string priority = string.Empty;
100+
string title = task.Title;
101+
if (title.Length >= 3 && title[0] == '(' && title[2] == ')' && title[3] == ' ')
102+
{
103+
priority = title.Substring(0, 4);
104+
title = title.Substring(3).Trim();
105+
}
106+
107+
string taskStr = $"{priority}{task.Updated.GetRfc3339Date().ToString("yyyy-MM-dd")} {title}";
99108
if (!string.IsNullOrEmpty(task.Due))
100109
{
101110
taskStr += $" due:{task.Due}";

0 commit comments

Comments
 (0)