From c64433999d45b7b5f773d0a76676ff9e6d9a0f72 Mon Sep 17 00:00:00 2001 From: Bryan Bugyi Date: Sun, 28 Apr 2019 15:46:57 -0400 Subject: [PATCH] Fix: sanity check before performing 'work' actions 'seek(0)' must be used to rewind the file first, since it was opened in append mode ('a+'). --- get-shit-done.py | 1 + 1 file changed, 1 insertion(+) diff --git a/get-shit-done.py b/get-shit-done.py index 59e784d..b76e7f5 100755 --- a/get-shit-done.py +++ b/get-shit-done.py @@ -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: