Skip to content

Commit 73bfa18

Browse files
authored
Rollup merge of #110123 - madsravn:master, r=jyn514
'./configure' now checks if 'config.toml' exists before writing to that destination Fixes #110109 Instead of overwriting the current `config.toml` file, exit the `./configure` script with a message stating why.
2 parents 3a5c8e9 + 010d797 commit 73bfa18

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/configure.py

+6
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,14 @@ def write_config_toml(writer, section_order, targets, sections):
521521
else:
522522
writer = write_uncommented(sections[section], writer)
523523

524+
def quit_if_file_exists(file):
525+
if os.path.isfile(file):
526+
err("Existing '" + file + "' detected.")
524527

525528
if __name__ == "__main__":
529+
# If 'config.toml' already exists, exit the script at this point
530+
quit_if_file_exists('config.toml')
531+
526532
p("processing command line")
527533
# Parse all known arguments into a configuration structure that reflects the
528534
# TOML we're going to write out

0 commit comments

Comments
 (0)