Skip to content

Commit

Permalink
✨ [+feature] Added decoration when bootstrapped w/package flag (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrownell authored Apr 6, 2024
2 parents ce8a44d + ae1b637 commit aa30fd9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ActivateEpilog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ----------------------------------------------------------------------
# |
# | ActivateEpilog.py
# |
# | David Brownell <[email protected]>
# | 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)))
11 changes: 11 additions & 0 deletions BootstrapEpilog.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@
# | Distributed under the MIT License.
# |
# ----------------------------------------------------------------------
import os
import subprocess
import sys

from pathlib import Path

# Parse the arguments
is_debug = False
is_force = False
is_verbose = False
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
Expand All @@ -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:
Expand All @@ -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)))

0 comments on commit aa30fd9

Please sign in to comment.