From 13c7d3bc2145fe0dfa3bd9e4d45fa32612289cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 6 Oct 2021 23:21:01 +0200 Subject: [PATCH] better Makefile and build script --- .gitignore | 2 ++ Makefile | 18 ++++++++++++++++-- build.py | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 85f404f..1ce2b59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.swp build/* +.gitconfiglock +.initsubmodulelock diff --git a/Makefile b/Makefile index 9139457..ac4a9c6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,18 @@ .PHONY: build -build: - python3 build.py +build: .initsubmodulelock + @python3 build.py + +init: .initsubmodulelock .gitconfiglock + +.initsubmodulelock: + @git submodule update --init + @touch .initsubmodulelock + +.gitconfiglock: + @echo "[Make config] Setting git configs to prevent wrong pushes" + @git config push.recurseSubmodules check + @git config status.submodulesummary 1 + @echo "[Push annotated tags by default]" + @git config push.followTags true + @touch .gitconfiglock diff --git a/build.py b/build.py index 633957b..44321fe 100644 --- a/build.py +++ b/build.py @@ -10,6 +10,7 @@ def build(build_dir: str): output = input_root / build_dir for file in input_root.rglob('*.pysty'): formatter = PackageFormatter(package_name=file.with_suffix('').name) + print('[PyTeX] Writing file {}'.format(formatter.file_name)) make_default_commands(formatter) formatter.format_package(file, Path('./').resolve() / build_dir / str(file.parent.relative_to(input_root)))