Skip to content

Commit

Permalink
introduce env var GRIPHOME for instance_path customization
Browse files Browse the repository at this point in the history
Use the environment variable GRIPHOME as instance_path if set, and fall
back to the default ~/.grip otherwise.
  • Loading branch information
zmwangx committed May 3, 2015
1 parent 093f908 commit abf3816
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion grip/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ def resolve_readme(path=None, force=False):


def _create_flask():
instance_path = os.path.abspath(os.path.expanduser('~/.grip'))
if 'GRIPHOME' in os.environ:
instance_path = os.environ['GRIPHOME']
else:
instance_path = os.path.abspath(os.path.expanduser('~/.grip'))
user_settings = os.path.join(instance_path, 'settings.py')
default_static_url_path = '/grip-static'

Expand Down

0 comments on commit abf3816

Please sign in to comment.