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 b55d7e2 commit c644339
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 @@ -61,6 +61,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 c644339

Please sign in to comment.