Skip to content

Commit d3f57de

Browse files
committed
Avoiding double print of note on gitignore changes
1 parent 337393d commit d3f57de

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/osw/auth.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,8 @@ def save_credentials_to_file(
308308
osw_dir_added = False
309309
# For every file path in the list of credentials file paths
310310
for _ii, fp in enumerate(cred_filepaths):
311-
to_add = ""
312311
if default_paths.osw_files_dir in fp.parents and not osw_dir_added:
313-
print(
312+
msg = (
314313
f"Adding '{default_paths.osw_files_dir}' to gitignore file "
315314
f"'{gitignore_fp}'."
316315
)
@@ -330,11 +329,11 @@ def save_credentials_to_file(
330329
)
331330
osw_dir_added = True
332331
else:
333-
print(f"Adding '{fp.name}' to gitignore file '{gitignore_fp}'.")
332+
msg = f"Adding '{fp.name}' to gitignore file '{gitignore_fp}'."
334333
to_add = f"\n*/{fp.name}"
335334
if not to_add or to_add in content:
336335
continue
337-
336+
print(msg)
338337
with open(gitignore_fp, "a") as stream:
339338
# Only add comment if not already set
340339
comment = (

0 commit comments

Comments
 (0)