Skip to content

Commit

Permalink
Allow ensure.py to add commented-out lines
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed May 27, 2024
1 parent 924adac commit e6edadd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ensure.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def ensure(fname, search_str, replace_str):
if (len(sys.argv) < 4):
usage()
(fname, key, value) = sys.argv[1:4]
search_str = f"{key}="
if (key.startswith('#')):
search_str = f"{key[1:].lstrip()}=" # Strip comments out for search purposes
replace_str = f"{key}={value}"
ensure(fname, search_str, replace_str)

0 comments on commit e6edadd

Please sign in to comment.