comparison contrib/packaging/hgpackaging/pyoxidizer.py @ 45922:37bcd7f5a543

pyoxidizer: make sure defaultrc directory exists before trying to write to it When doing some work involving one-file binaries, this line is failing for me. It seems reasonable to just make sure the destination directory exists before splatting the file into it. Differential Revision: https://phab.mercurial-scm.org/D9401
author Augie Fackler <augie@google.com>
date Wed, 25 Nov 2020 11:08:28 -0500
parents 57b5452a55d5
children 41be7698a4fd
comparison
equal deleted inserted replaced
45921:777e8d88f703 45922:37bcd7f5a543
125 if "windows" in target_triple: 125 if "windows" in target_triple:
126 process_install_rules(STAGING_RULES_WINDOWS, source_dir, out_dir) 126 process_install_rules(STAGING_RULES_WINDOWS, source_dir, out_dir)
127 127
128 # Write out a default editor.rc file to configure notepad as the 128 # Write out a default editor.rc file to configure notepad as the
129 # default editor. 129 # default editor.
130 os.makedirs(out_dir / "defaultrc", exist_ok=True)
130 with (out_dir / "defaultrc" / "editor.rc").open( 131 with (out_dir / "defaultrc" / "editor.rc").open(
131 "w", encoding="utf-8" 132 "w", encoding="utf-8"
132 ) as fh: 133 ) as fh:
133 fh.write("[ui]\neditor = notepad\n") 134 fh.write("[ui]\neditor = notepad\n")
134 135