Skip to content

Commit 0e8c61d

Browse files
author
Adrien Delle Cave
committed
[RELEASE] version: 0.0.27.
1 parent b9a0b4b commit 0e8c61d

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
json-dotenv (0.0.27) unstable; urgency=medium
2+
3+
* [RELEASE] version: 0.0.27.
4+
5+
-- Adrien DELLE CAVE (Decryptus) <adc@doowan.net> Sun, 27 Nov 2022 05:26:52 +0100
6+
17
json-dotenv (0.0.26) unstable; urgency=medium
28

39
* [RELEASE] version: 0.0.26.

RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.26
1+
0.0.27

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.26
1+
0.0.27

bin/json-dotenv

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ json-dotenv
88

99
from __future__ import absolute_import
1010

11-
__version__ = '0.0.26'
11+
__version__ = '0.0.27'
1212

1313
import argparse
1414
import json
@@ -259,6 +259,10 @@ class JsonDotEnv(object): # pylint: disable=bad-option-value,useless-object-inhe
259259

260260
return "\n".join(r)
261261

262+
@staticmethod
263+
def _rstrip_cr(s):
264+
return re.sub(r'\\n$', '', s)
265+
262266
def _parse_file(self):
263267
if self.options.file == '-':
264268
xfile = StringIO(sys.stdin.read())
@@ -277,27 +281,24 @@ class JsonDotEnv(object): # pylint: disable=bad-option-value,useless-object-inhe
277281
if MATCH_VAR_NAME_QUOTE(x):
278282
if cur:
279283
if quoted is False:
280-
cur = cur.rstrip("\\n")
281-
cur += '"'
282-
content.append(self.escape_variable(cur.rstrip("\\n")))
284+
cur = self._rstrip_cr(cur) + '"'
285+
content.append(self.escape_variable(self._rstrip_cr(cur)))
283286
quoted = True
284287
cur = self.raw_string(x)
285288
elif MATCH_VAR_NAME(x):
286289
if cur:
287290
if quoted is False:
288-
cur = cur.rstrip("\\n")
289-
cur += '"'
290-
content.append(self.escape_variable(cur.rstrip("\\n")))
291+
cur = self._rstrip_cr(cur) + '"'
292+
content.append(self.escape_variable(self._rstrip_cr(cur)))
291293
quoted = False
292294
cur = '{0}="{1}'.format(*self.raw_string(x).split('=', 1))
293295
else:
294296
cur += self.raw_string(x)
295297

296298
if cur:
297299
if quoted is False:
298-
cur = cur.rstrip("\\n")
299-
cur += '"'
300-
content.append(self.escape_variable(cur.rstrip("\\n")))
300+
cur = self._rstrip_cr(cur) + '"'
301+
content.append(self.escape_variable(self._rstrip_cr(cur)))
301302

302303
if xfile:
303304
xfile.close()

setup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: json-dotenv
44
author: Adrien Delle Cave
55
author_email: pypi@doowan.net
66
copyright: '2019-2022 Adrien Delle Cave'
7-
release: '0.0.26'
8-
version: '0.0.26'
7+
release: '0.0.27'
8+
version: '0.0.27'
99
license: License GPL-3
1010
url: https://github.com/decryptus/json-dotenv
1111
python_requires:

0 commit comments

Comments
 (0)