Changing position of early exit and using standard error method with correct exit code
This commit is contained in:
parent
69b12ff570
commit
010d7975d6
1 changed files with 4 additions and 4 deletions
|
@ -523,17 +523,17 @@ def write_config_toml(writer, section_order, targets, sections):
|
||||||
|
|
||||||
def quit_if_file_exists(file):
|
def quit_if_file_exists(file):
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
p("Existing '" + file + "' detected. EXITING")
|
err("Existing '" + file + "' detected.")
|
||||||
quit()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
# If 'config.toml' already exists, exit the script at this point
|
||||||
|
quit_if_file_exists('config.toml')
|
||||||
|
|
||||||
p("processing command line")
|
p("processing command line")
|
||||||
# Parse all known arguments into a configuration structure that reflects the
|
# Parse all known arguments into a configuration structure that reflects the
|
||||||
# TOML we're going to write out
|
# TOML we're going to write out
|
||||||
p("")
|
p("")
|
||||||
section_order, sections, targets = parse_args(sys.argv[1:])
|
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
|
# Now that we've built up our `config.toml`, write it all out in the same
|
||||||
# order that we read it in.
|
# order that we read it in.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue