adjust build script and Makefile
This commit is contained in:
parent
1b442a50fd
commit
c18b4ad0e4
2 changed files with 6 additions and 2 deletions
4
Makefile
Normal file
4
Makefile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.PHONY: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
python3 build.py
|
4
build.py
4
build.py
|
@ -6,12 +6,12 @@ from package_formatter import PackageFormatter
|
||||||
from replacements import make_default_commands
|
from replacements import make_default_commands
|
||||||
|
|
||||||
def build(build_dir: str):
|
def build(build_dir: str):
|
||||||
input_root = Path('.').resolve()
|
input_root = Path('./packages').resolve()
|
||||||
output = input_root / build_dir
|
output = input_root / build_dir
|
||||||
for file in input_root.rglob('*.pysty'):
|
for file in input_root.rglob('*.pysty'):
|
||||||
formatter = PackageFormatter(package_name=file.with_suffix('').name)
|
formatter = PackageFormatter(package_name=file.with_suffix('').name)
|
||||||
make_default_commands(formatter)
|
make_default_commands(formatter)
|
||||||
formatter.format_package(file, input_root / build_dir / str(file.parent.relative_to(input_root)))
|
formatter.format_package(file, Path('./').resolve() / build_dir / str(file.parent.relative_to(input_root)))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
build('build')
|
build('build')
|
||||||
|
|
Loading…
Reference in a new issue