From ef844d510c7f44410fb64b36d617e9c25f879af8 Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Wed, 22 Nov 2017 13:45:23 -0800 Subject: [PATCH] Another attempt to fix CRLF/LF issues --- .bin/Scripts/functions/update.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 3540302d..f0d1ed4f 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -100,12 +100,6 @@ def generate_launcher(section, name, options): new_opt = 'set {}='.format(opt) f_options[new_opt] = ['set {}={}'.format(opt, options[opt])] - # Remove existing launcher - os.makedirs(dest, exist_ok=True) - if os.path.exists(full_path): - remove_item(full_path) - sleep(0.25) - # Read template and update using f_options out_text = [] with open(template, 'r') as f: @@ -117,8 +111,12 @@ def generate_launcher(section, name, options): out_text.extend(f_options[line]) else: out_text.append(line) + + # Write file + os.makedirs(dest, exist_ok=True) with open(full_path, 'w') as f: - f.writelines(out_text) + # f.writelines(out_text) + f.write('\n'.join(out_text)) def remove_item(item_path): if os.path.exists(item_path):