diff --git a/ActivateEpilog.py b/ActivateEpilog.py new file mode 100644 index 0000000..a7530e4 --- /dev/null +++ b/ActivateEpilog.py @@ -0,0 +1,24 @@ +# ---------------------------------------------------------------------- +# | +# | ActivateEpilog.py +# | +# | David Brownell +# | 2024-04-06 19:49:00 +# | +# ---------------------------------------------------------------------- +# | +# | Copyright David Brownell 2024 +# | Distributed under the MIT License. +# | +# ---------------------------------------------------------------------- +import json +import os +import sys + +from pathlib import Path + +with (Path(os.environ["PYTHON_BOOTSTRAPPER_GENERATED_DIR"]) / "bootstrap_flags.json").open() as f: + flags = json.load(f) + +if flags: + sys.stdout.write("\nBootstrapped with {}.\n".format(", ".join(f"'{flag}'" for flag in flags))) diff --git a/BootstrapEpilog.py b/BootstrapEpilog.py index 56265d2..073de4b 100644 --- a/BootstrapEpilog.py +++ b/BootstrapEpilog.py @@ -11,9 +11,12 @@ # | Distributed under the MIT License. # | # ---------------------------------------------------------------------- +import os import subprocess import sys +from pathlib import Path + # Parse the arguments is_debug = False is_force = False @@ -21,6 +24,8 @@ is_package = False no_cache = False +display_flags: list[str] = [] + for arg in sys.argv[ 2: ]: # First arg is the script name, second arg is the name of the shell script to write to @@ -32,6 +37,7 @@ is_verbose = True elif arg == "--package": is_package = True + display_flags.append("package") elif arg == "--no-cache": no_cache = True else: @@ -48,3 +54,8 @@ check=True, shell=True, ) + +with ( + Path(__file__).parent / os.environ["PYTHON_BOOTSTRAPPER_GENERATED_DIR"] / "bootstrap_flags.json" +).open("w") as f: + f.write("[{}]".format(", ".join(f'"{flag}"' for flag in display_flags)))