From 4b5638138254ef280b8f4c9a825324ef9e2f646f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 9 May 2023 07:10:40 -0700 Subject: [PATCH] strip() the before_text when looking for empty ORIGINAL --- coder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coder.py b/coder.py index 7ac42252b..eb93d3ed9 100755 --- a/coder.py +++ b/coder.py @@ -389,13 +389,13 @@ class Coder: fname = Path(fname) # does it want to make a new file? - if not fname.exists() and not before_text: + if not fname.exists() and not before_text.strip(): print("Creating empty file:", fname) fname.touch() content = fname.read_text() - if not before_text: + if not before_text.strip(): if content: new_content = content + after_text else: