mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
misc(installer): Added cleanup step (for master builds) (#1838)
* misc(installer): Added cleanup step (for master builds) * Update _cleanup.php * Update install.php * Update install.php * Update install.php * Update install.php
This commit is contained in:
parent
b954815f5d
commit
dd721367c7
2 changed files with 29 additions and 8 deletions
15
_cleanup.php
15
_cleanup.php
|
@ -7,12 +7,15 @@
|
|||
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||||
*/
|
||||
|
||||
if (!defined('BB_ROOT')) {
|
||||
define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
// Check CLI mode
|
||||
if (php_sapi_name() !== 'cli') {
|
||||
exit;
|
||||
}
|
||||
|
||||
define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
|
||||
$items = [
|
||||
'.github',
|
||||
'.editorconfig',
|
||||
|
@ -47,9 +50,9 @@ foreach ($items as $item) {
|
|||
function removeFile(string $file): void
|
||||
{
|
||||
if (unlink($file)) {
|
||||
echo "[INFO] File removed: $file" . PHP_EOL;
|
||||
echo "- File removed: $file" . PHP_EOL;
|
||||
} else {
|
||||
echo "[ERROR] File cannot be removed: $file" . PHP_EOL;
|
||||
echo "- File cannot be removed: $file" . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +76,9 @@ function removeDir(string $dir): void
|
|||
}
|
||||
|
||||
if (rmdir($dir)) {
|
||||
echo "[INFO] Folder removed: $dir" . PHP_EOL;
|
||||
echo "- Folder removed: $dir" . PHP_EOL;
|
||||
} else {
|
||||
echo "[ERROR] Folder cannot be removed: $dir" . PHP_EOL;
|
||||
echo "- Folder cannot be removed: $dir" . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue