From a7826fba580c3fca68d1bb6c576cbb50e57a4a6d Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 24 Feb 2023 15:15:56 -0600 Subject: [PATCH] refactor: move script to scripts duh --- Makefile | 2 +- generate-all.py => scripts/generate-all.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) rename generate-all.py => scripts/generate-all.py (77%) diff --git a/Makefile b/Makefile index 4126ed4..61d44cd 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ docs/png/%.png: docs/svg/%.svg @inkscape --export-filename=$@ $< svgs: $(SRC) ## generate all of the logo svgs - ./generate-all.py $(REV) + ./scripts/generate-all.py $(REV) lint: ## apply isort/black/flake8 @isort logo diff --git a/generate-all.py b/scripts/generate-all.py similarity index 77% rename from generate-all.py rename to scripts/generate-all.py index aa8e3ba..2131d87 100755 --- a/generate-all.py +++ b/scripts/generate-all.py @@ -5,14 +5,15 @@ from pathlib import Path from logo import generate +PROJECT_ROOT = Path(__file__).parent.parent def main(): rev = sys.argv[1] comment = f"© 2022 Daylin Morgan | rev. {rev}" - if not (Path.cwd() / "docs" / "svg").is_dir(): + if not ( PROJECT_ROOT / "docs" / "svg").is_dir(): print("making docs directory") - (Path.cwd() / "docs" / "svg").mkdir(exist_ok=True) + (PROJECT_ROOT / "docs" / "svg").mkdir(exist_ok=True) for theme in ["dark", "light"]: for background in ["rect", "circle", None]: @@ -24,7 +25,7 @@ def main(): name.append("b") name.append(theme) - name = f"docs/svg/{'-'.join(name)}.svg" + name = f"{PROJECT_ROOT}/docs/svg/{'-'.join(name)}.svg" generate( name=name, background=background, @@ -34,7 +35,7 @@ def main(): ) generate( - name=f"docs/{theme}.svg", + name=f"{PROJECT_ROOT}/docs/{theme}.svg", background="circle", border=True, theme=theme,