ensure ~/.aeromancer exists

This commit is contained in:
Doug Hellmann 2014-11-11 15:26:28 -05:00
parent 39d04454ee
commit e56b2fb739
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,11 @@ class Aeromancer(App):
return
def initialize_app(self, argv):
# Make sure our application directory exists, so we have a
# place to put the database and any other configuration files.
self.app_dir = os.path.expanduser('~/.aeromancer')
if not os.path.exists(self.app_dir):
os.mkdir(self.app_dir)
self.log.debug('updating database')
migrations.run_migrations()
self.engine = connect.connect()