From 02a2ecbf97da60d8410602a8e21fbea5ac0babbc Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Thu, 10 Apr 2014 15:57:24 -0400 Subject: [PATCH] Create path to journal during installation Fixes #152 --- jrnl/install.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jrnl/install.py b/jrnl/install.py index fa78ca0c..128c7827 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -81,6 +81,12 @@ def install_jrnl(config_path='~/.jrnl_config'): password = None print("PyCrypto not found. To encrypt your journal, install the PyCrypto package from http://www.pycrypto.org or with 'pip install pycrypto' and run 'jrnl --encrypt'. For now, your journal will be stored in plain text.") + path = os.path.split(default_config['journals']['default'])[0] # If the folder doesn't exist, create it + try: + os.makedirs(path) + except OSError: + pass + open(default_config['journals']['default'], 'a').close() # Touch to make sure it's there # Write config to ~/.jrnl_conf