Skip to content

Commit

Permalink
Fix: sanity check before performing 'work' actions
Browse files Browse the repository at this point in the history
'seek(0)' must be used to rewind the file first, since it was opened
in append mode ('a+').
  • Loading branch information
bbugyi200 committed Apr 28, 2019
1 parent d0d04e7 commit 8fadf70
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions get-shit-done.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def rehash():

def work():
hFile = open(hosts_file, 'a+')
hFile.seek(0)
contents = hFile.read()

if start_token in contents and end_token in contents:
Expand Down

0 comments on commit 8fadf70

Please sign in to comment.