29 lines
448 B
PHP
29 lines
448 B
PHP
<?php
|
|
|
|
$base = file_get_contents(__DIR__."/src/base.sh");
|
|
|
|
|
|
$dirs = [
|
|
__DIR__.'/src/functions/*.sh'
|
|
];
|
|
|
|
$codes = [];
|
|
|
|
foreach($dirs as $dir){
|
|
foreach(glob($dir) as $file){
|
|
$codes[$file] = file_get_contents($file);
|
|
}
|
|
}
|
|
|
|
$code = str_replace("{{ CODES }}", implode("\n", $codes), $base);
|
|
|
|
try {
|
|
$file = __DIR__.'/init.sh';
|
|
$file = fopen($file, "w");
|
|
fwrite($file, $code);
|
|
fclose($file);
|
|
} catch (\Error $e) {
|
|
}
|
|
|
|
?>
|