about summary refs log tree commit diff
path: root/src/bootstrap/configure.py
diff options
context:
space:
mode:
authorMads Ravn <madsravn@gmail.com>2023-04-09 22:50:42 +0200
committerMads Ravn <madsravn@gmail.com>2023-04-09 22:50:42 +0200
commit9aa3f053d705502e60a5167afedbbcfe1d36cded (patch)
treebecfc7fef7fd47a85e4b1e9b8206a77206730a15 /src/bootstrap/configure.py
parent39bf7777aab9ac1f6b0802cd52cd91d6e021aa91 (diff)
downloadrust-9aa3f053d705502e60a5167afedbbcfe1d36cded.tar.gz
rust-9aa3f053d705502e60a5167afedbbcfe1d36cded.zip
'./configure' now checks if 'config.toml' exists before writing to that destination
Diffstat (limited to 'src/bootstrap/configure.py')
-rwxr-xr-xsrc/bootstrap/configure.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index abd28b4005d..716077adc75 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -521,6 +521,10 @@ def write_config_toml(writer, section_order, targets, sections):
         else:
             writer = write_uncommented(sections[section], writer)
 
+def quit_if_file_exists(file):
+    if os.path.isfile(file):
+        p("Existing '" + file + "' detected. EXITING")
+        quit()
 
 if __name__ == "__main__":
     p("processing command line")
@@ -528,6 +532,8 @@ if __name__ == "__main__":
     # TOML we're going to write out
     p("")
     section_order, sections, targets = parse_args(sys.argv[1:])
+    # If 'config.toml' already exists, exit the script at this point
+    quit_if_file_exists('config.toml')
 
     # Now that we've built up our `config.toml`, write it all out in the same
     # order that we read it in.