b0cc468155
- RepositorySynchronizer defaults to GiteaAdapter - PlatformAdapterFactory points to git.mokoconsulting.tech - All plugins reference .gitea/workflows instead of .github/workflows - push_files.php uses Gitea API - Common.php REPO URLs updated to Gitea - sync_dolibarr_readmes.php updated to Gitea URLs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
949 B
PHP
39 lines
949 B
PHP
#!/usr/bin/env php
|
|
<?php
|
|
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
* FILE INFORMATION
|
|
* DEFGROUP: MokoStandards.CLI
|
|
* INGROUP: MokoStandards
|
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
|
|
* PATH: /cli/version_read.php
|
|
* VERSION: 04.06.00
|
|
* BRIEF: Read VERSION from README.md — outputs just the version string
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
$path = '.';
|
|
foreach ($argv as $i => $arg) {
|
|
if ($arg === '--path' && isset($argv[$i + 1])) {
|
|
$path = $argv[$i + 1];
|
|
}
|
|
}
|
|
|
|
$readme = realpath($path) . '/README.md';
|
|
if (!file_exists($readme)) {
|
|
fwrite(STDERR, "No README.md found at {$path}\n");
|
|
exit(1);
|
|
}
|
|
|
|
$content = file_get_contents($readme);
|
|
if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
|
|
echo $m[1] . "\n";
|
|
exit(0);
|
|
}
|
|
|
|
fwrite(STDERR, "No VERSION field found in README.md\n");
|
|
exit(1);
|