Generator Update
This commit is contained in:
parent
ee152b0562
commit
91ae087bd4
@ -7,18 +7,13 @@ $dirs = [
|
|||||||
__DIR__.'/src/commands/*.sh',
|
__DIR__.'/src/commands/*.sh',
|
||||||
__DIR__.'/src/commands/*/*.sh',
|
__DIR__.'/src/commands/*/*.sh',
|
||||||
__DIR__.'/src/commands/*/*/*.sh',
|
__DIR__.'/src/commands/*/*/*.sh',
|
||||||
__DIR__.'/src/functions/*.sh',
|
__DIR__.'/src/functions/*.sh'
|
||||||
__DIR__.'/src/elements.sh'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$codes = [];
|
$codes = [];
|
||||||
|
|
||||||
foreach($dirs as $dir){
|
foreach($dirs as $dir){
|
||||||
foreach(glob($dir) as $file){
|
foreach(glob($dir) as $file){
|
||||||
if(str_contains($dir, "elements")){
|
|
||||||
echo $dir;
|
|
||||||
$codes['elements'][$file] = file_get_contents($file);
|
|
||||||
}
|
|
||||||
if(str_contains($dir, "functions")){
|
if(str_contains($dir, "functions")){
|
||||||
$codes['functions'][$file] = file_get_contents($file);
|
$codes['functions'][$file] = file_get_contents($file);
|
||||||
}
|
}
|
||||||
@ -28,8 +23,7 @@ foreach($dirs as $dir){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = str_replace("{{ ELEMENTS }}", implode("\n", $codes['elements']), $base);
|
$code = str_replace("{{ FUNCTIONS }}", implode("\n", $codes['functions']), $base);
|
||||||
$code = str_replace("{{ FUNCTIONS }}", implode("\n", $codes['functions']), $code);
|
|
||||||
$code = str_replace("{{ COMMANDS }}", implode("\n", $codes['commands']), $code);
|
$code = str_replace("{{ COMMANDS }}", implode("\n", $codes['commands']), $code);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -37,10 +31,7 @@ try {
|
|||||||
$file = fopen($file, "w");
|
$file = fopen($file, "w");
|
||||||
fwrite($file, $code);
|
fwrite($file, $code);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
echo "Status: Successful";
|
|
||||||
} catch (\Error $e) {
|
} catch (\Error $e) {
|
||||||
echo "Status: Failed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user