Compare commits

..

3 Commits

5 changed files with 11 additions and 5 deletions

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
nim 1.6.20

View File

@ -1,6 +1,6 @@
# Package
version = "4.25.0"
version = "4.25.2"
author = "Jonathan Bernard"
description = "Personal issue tracker."
license = "MIT"

View File

@ -269,7 +269,7 @@ proc list(
it.hasProp("completed") and
sameDay(getTime().local, it.getDateTime("completed")))
if isatty(stdin):
if isatty(stdout):
stdout.write ctx.formatSection(ctx.issues[state], state, "", verbose)
else:
@ -305,7 +305,7 @@ proc list(
not (it.hasProp("hide-until") and
it.getDateTime("hide-until") > getTime().local))
if isatty(stdin):
if isatty(stdout):
stdout.write ctx.formatSection(visibleIssues, s, indent, verbose)
else:
@ -328,7 +328,7 @@ proc list(
not (it.hasProp("hide-until") and
it.getDateTime("hide-until") > getTime().local))
if isatty(stdin):
if isatty(stdout):
stdout.write ctx.formatSection(visibleIssues, s, indent, verbose)
else:

View File

@ -1,4 +1,4 @@
const PIT_VERSION* = "4.25.0"
const PIT_VERSION* = "4.25.2"
const USAGE* = """Usage:
pit ( new | add) <summary> [<state>] [options]

View File

@ -328,11 +328,16 @@ proc loadAllIssues*(tasksDir: string): TableRef[IssueState, seq[Issue]] =
for state in IssueState: result[state] = tasksDir.loadIssues(state)
proc changeState*(issue: Issue, tasksDir: string, newState: IssueState) =
var dbgInfo = "[$#] changing state: $#$#" %
[ ($issue.id)[0..<6], $issue.state, $newState ]
let oldFilepath = issue.filepath
if newState == Done: issue.setDateTime("completed", getTime().local)
tasksDir.store(issue, newState)
if oldFilePath != issue.filepath: removeFile(oldFilepath)
dbgInfo &= "\n\told path: $#\n\tnew path: $#" % [oldFilePath, issue.filepath]
issue.state = newState
debug dbgInfo
proc delete*(issue: Issue) = removeFile(issue.filepath)