From 182e8447b23b732492fadc821447b81175d57f9e Mon Sep 17 00:00:00 2001
From: Bart Jaskulski <bjaskulski@protonmail.com>
Date: Tue, 25 Apr 2023 12:44:25 +0200
Subject: [PATCH] feat: add VERY simple command to cache plugin data

Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com>
---
 bin/wpinit    | 17 +++++++++++++++++
 composer.json |  3 +++
 2 files changed, 20 insertions(+)
 create mode 100755 bin/wpinit

diff --git a/bin/wpinit b/bin/wpinit
new file mode 100755
index 0000000..219c77d
--- /dev/null
+++ b/bin/wpinit
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+<?php
+
+use WPDesk\Init\Dumper\PhpFileDumper;
+
+include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
+
+$filename = $argv[1] ?? null;
+
+$parser = new \WPDesk\Init\PluginHeaderParser();
+
+$data = $parser->parse( $filename );
+
+$dumper = new PhpFileDumper();
+$dumper->dump( $parser->parse( $filename ), $argv[2] );
+
+//echo "Compile static plugin resources.";
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 598dab2..22b0db0 100644
--- a/composer.json
+++ b/composer.json
@@ -21,6 +21,9 @@
       "role": "Developer"
     }
   ],
+  "bin": [
+    "bin/wpinit"
+  ],
   "autoload": {
     "psr-4": {
       "WPDesk\\Init\\": "src"
-- 
GitLab