mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
Update _release.php
This commit is contained in:
parent
e813f1ef5d
commit
49ae59e557
1 changed files with 7 additions and 7 deletions
14
_release.php
14
_release.php
|
@ -21,6 +21,9 @@ require_once BB_ROOT . 'library/defines.php';
|
|||
// Include CLI functions
|
||||
require INC_DIR . '/functions_cli.php';
|
||||
|
||||
// Welcoming message
|
||||
out("--- Release creation tool ---\n", 'info');
|
||||
|
||||
$configFile = BB_PATH . '/library/config.php';
|
||||
|
||||
if (!is_file($configFile)) {
|
||||
|
@ -33,9 +36,6 @@ if (!is_writable($configFile)) {
|
|||
out('- Config file ' . basename($configFile) . ' is not writable', 'error');
|
||||
}
|
||||
|
||||
// Welcoming message
|
||||
out("--- Release creation tool ---\n", 'info');
|
||||
|
||||
// Ask for version
|
||||
fwrite(STDOUT, 'Enter version number (e.g, v2.4.0): ');
|
||||
$version = trim(fgets(STDIN));
|
||||
|
@ -51,7 +51,7 @@ if (empty($date)) {
|
|||
// Validate date format (dd-mm-yyyy)
|
||||
$dateObj = DateTime::createFromFormat('d-m-Y', $date);
|
||||
if (!$dateObj || $dateObj->format('d-m-Y') !== $date) {
|
||||
out('Invalid date format. Expected format: DD-MM-YYYY', 'error');
|
||||
out("\n- Invalid date format. Expected format: DD-MM-YYYY", 'error');
|
||||
}
|
||||
|
||||
out("- Using date: $date", 'info');
|
||||
|
@ -78,13 +78,13 @@ $content = preg_replace(
|
|||
$bytesWritten = file_put_contents($configFile, $content);
|
||||
|
||||
if ($bytesWritten === false) {
|
||||
out('Failed to write to config file', 'error');
|
||||
out("\n- Failed to write to config file", 'error');
|
||||
}
|
||||
|
||||
if ($bytesWritten === 0) {
|
||||
out('Config file was not updated (0 bytes written)', 'error');
|
||||
out("\n- Config file was not updated (0 bytes written)", 'error');
|
||||
}
|
||||
|
||||
out('- Config file has been updated!', 'success');
|
||||
out("\n- Config file has been updated!", 'success');
|
||||
|
||||
// Git add & commit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue