Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
0c3d73dc2b | |||
9a0bf35882 | |||
be7c099b7b |
1
.tool-versions
Normal file
1
.tool-versions
Normal file
@ -0,0 +1 @@
|
||||
nim 1.6.20
|
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "4.25.0"
|
||||
version = "4.25.2"
|
||||
author = "Jonathan Bernard"
|
||||
description = "Personal issue tracker."
|
||||
license = "MIT"
|
||||
|
@ -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:
|
||||
|
@ -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]
|
||||
|
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user