Added WordPress files generation to build process - really fast and dirty coding.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user