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,