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
22
install.php
22
install.php
|
@ -7,7 +7,7 @@
|
|||
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||||
*/
|
||||
|
||||
define('BB_ROOT', __DIR__ . '/');
|
||||
define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
|
||||
// Check CLI mode
|
||||
if (php_sapi_name() !== 'cli') {
|
||||
|
@ -185,7 +185,7 @@ if (!defined('EXTENSIONS_NOT_INSTALLED')) {
|
|||
if (is_file(BB_ROOT . '.env')) {
|
||||
out('- TorrentPier already installed', 'warning');
|
||||
echo 'Are you sure want to re-install TorrentPier? [y/N]: ';
|
||||
if (str_starts_with(mb_strtolower(readline()), 'y')) {
|
||||
if (str_starts_with(mb_strtolower(trim(readline())), 'y')) {
|
||||
out("\n- Re-install process started...", 'info');
|
||||
// environment
|
||||
if (is_file(BB_ROOT . '.env')) {
|
||||
|
@ -415,5 +415,23 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Cleanup...
|
||||
if (is_file(BB_ROOT . '_cleanup.php')) {
|
||||
out("\n--- Finishing installation (Cleanup) ---\n", 'info');
|
||||
out('The cleanup process will remove:');
|
||||
out('- Development documentation (README, CHANGELOG)', 'debug');
|
||||
out('- Git configuration files', 'debug');
|
||||
out('- CI/CD pipelines and code analysis tools', 'debug');
|
||||
out('- Translation and contribution guidelines', 'debug');
|
||||
echo 'Do you want to delete these files permanently? [y/N]: ';
|
||||
if (str_starts_with(mb_strtolower(trim(readline())), 'y')) {
|
||||
out("\n- Cleanup...", 'info');
|
||||
require_once BB_ROOT . '_cleanup.php';
|
||||
unlink(BB_ROOT . '_cleanup.php');
|
||||
} else {
|
||||
out('- Skipping...', 'info');
|
||||
}
|
||||
}
|
||||
|
||||
out("\n- Voila! Good luck & have fun!", 'success');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue