Skip to content

Commit

Permalink
Add support for multiline strings in .env
Browse files Browse the repository at this point in the history
We previously supported this but regressed support in
08063ea.

Fixes #128.
Closes #129.
  • Loading branch information
nickstenning committed Mar 10, 2015
1 parent 0f604a5 commit 920b0b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions honcho/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def parse(content):
continue
if not re.match(r'[A-Za-z_][A-Za-z_0-9]*', name):
continue

value = value.decode('string_escape')
values[name] = value

return values
Expand Down
15 changes: 14 additions & 1 deletion honcho/test/unit/test_environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,20 @@
MYVAR='sp ace'
""",
{'MYVAR': 'sp ace'}
]
],
[
# Escaped characters in value
r"""
TABS='foo\tbar'
NEWLINES='foo\nbar'
VTAB='foo\vbar'
DOLLAR='foo\$bar'
""",
{'TABS': 'foo\tbar',
'NEWLINES': 'foo\nbar',
'VTAB': 'foo\vbar',
'DOLLAR': 'foo\\$bar'}
],
]

PROCFILE_FIXTURES = [
Expand Down

0 comments on commit 920b0b0

Please sign in to comment.