From b62a977bd5edda43a6befc4f257ad5e5a841f1a9 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 28 Jun 2016 18:15:42 -0400 Subject: [PATCH] TI-16: Should handle case where taskwarrior hook is used before timew - Thanks to Aaron Curtis. --- AUTHORS | 1 + ChangeLog | 6 ++++-- ext/on-modify.timewarrior | 4 ++-- src/init.cpp | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 32f1a104..de7645bb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,3 +25,4 @@ suggestions: Ben Boeckel Wade Duvall Sebastian Uharek + Aaron Curtis diff --git a/ChangeLog b/ChangeLog index 1e9dd25c..1bdcdeae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,11 @@ 1.0.0 - +- TI-16 Should handle case where taskwarrior hook is used before timew + (thanks to Aaron Curtis). - timew 0.9.5~alpha install bug - (thanks to Gordon Ball). + (thanks to Gordon Ball). - Improved out-of-source build for themes, holidays - (thanks to Kent R. Spillner). + (thanks to Kent R. Spillner). ------ current release --------------------------- diff --git a/ext/on-modify.timewarrior b/ext/on-modify.timewarrior index 955949d1..c01acd59 100755 --- a/ext/on-modify.timewarrior +++ b/ext/on-modify.timewarrior @@ -54,9 +54,9 @@ combined = ' '.join(['"%s"' % tag for tag in tags]) # Started task. if 'start' in new and not 'start' in old: - os.system('timew start ' + combined) + os.system('timew start ' + combined + ' :yes') # Stopped task. elif not 'start' in new and 'start' in old: - os.system('timew stop ' + combined) + os.system('timew stop ' + combined + ' :yes') diff --git a/src/init.cpp b/src/init.cpp index 37a8fb87..ad13dfb8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -158,7 +158,8 @@ void initializeDataAndRules ( // If dbLocation does not exist, ask whether it should be created. bool shinyNewDatabase = false; if (! dbLocation.exists () && - confirm ("Create new database in " + dbLocation._data + "?")) + (findHint (cli, ":yes") || + confirm ("Create new database in " + dbLocation._data + "?"))) { dbLocation.create (0700); shinyNewDatabase = true;