From e9b8f04c2452ae7eb48351d462a84f3f913fba32 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Wed, 11 Feb 2015 21:45:32 -0500 Subject: [PATCH] Bug fix A bug was introduced in 2.1.6 that would prevent user-defined cheatsheets from being edited more than once. --- bin/cheat | 2 +- cheat/sheet.py | 4 ++++ setup.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/cheat b/bin/cheat index 1dfedf4..2222fa0 100755 --- a/bin/cheat +++ b/bin/cheat @@ -38,7 +38,7 @@ from docopt import docopt if __name__ == '__main__': # parse the command-line options - options = docopt(__doc__, version='cheat 2.1.6') + options = docopt(__doc__, version='cheat 2.1.7') # list directories if options['--directories']: diff --git a/cheat/sheet.py b/cheat/sheet.py index f4e380f..f2f4e6d 100644 --- a/cheat/sheet.py +++ b/cheat/sheet.py @@ -32,6 +32,10 @@ def create_or_edit(sheet): copy(path(sheet), os.path.join(sheets.default_path(), sheet)) edit(sheet) + # if it exists and is in the default path, then just open it + else: + edit(sheet) + def create(sheet): """ Creates a cheatsheet """ diff --git a/setup.py b/setup.py index 6a81c99..cb4972c 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os setup( name = 'cheat', - version = '2.1.6', + version = '2.1.7', author = 'Chris Lane', author_email = 'chris@chris-allen-lane.com', license = 'GPL3',