Skip to content

Commit

Permalink
fix: removed empty line when reading 1PIF file
Browse files Browse the repository at this point in the history
  • Loading branch information
davidandreoletti committed Jan 23, 2024
1 parent 176ab37 commit 5d2ded8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pass_import/managers/onepassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def pif2json(file):
data = file.read()
cleaned = re.sub(r'(?m)^\*\*\*.*\*\*\*\s+', '', data)
cleaned = cleaned.split('\n')
# On 1Password v7.9.11 (macOS), 1PIF export produces 1 extra empty line
cleaned = [v for v in cleaned if len(v) > 0]
cleaned = ','.join(cleaned).rstrip(',')
cleaned = f'[{cleaned}]'
return json.loads(cleaned)
Expand Down

0 comments on commit 5d2ded8

Please sign in to comment.