Added WordPress files generation to build process - really fast and dirty coding.

This commit is contained in:
2022-10-24 19:17:26 +03:00
parent c5502e2be2
commit b5d23d612f
8 changed files with 431 additions and 936 deletions
+4 -3
View File
@@ -54,14 +54,15 @@ class Component_Builder {
public string $component_name = '';
private string $module_path = '';
function __construct( $component_name, $module_path ) {
function __construct( $component_name, $module_path, $project_path ) {
$this->module_path = $module_path;
$this->project_path = $project_path;
$this->component_name = $component_name;
$this->register_default_handlebar_helpers();
}
function build(): void {
$root_path = __DIR__ . '/' . $this->module_path . '/../..';
$root_path = __DIR__ . '/' . $this->module_path . '/../../' . $this->project_path;
$file_name = $this->get_handlebars_template( "$root_path/src/$this->component_name.template.hbs" );
$output_folder = $root_path . '/exports/wordpress/templates';
@@ -122,4 +123,4 @@ class Component_Builder {
}
}
( new Component_Builder( $argv[1], $argv[2] ) )->build();
( new Component_Builder( $argv[1], $argv[2], $argv[3] ) )->build();