Skip to content

A self-hosted media server and file management system

fix: static version in manifest isn't truncated

aminnausinecc935bb9d09
diff --git a/app/Console/Commands/GenerateManifest.php b/app/Console/Commands/GenerateManifest.php
index 30dfe47f..e86ea5ca 100644
--- a/app/Console/Commands/GenerateManifest.php
+++ b/app/Console/Commands/GenerateManifest.php
@@ -11,13 +11,15 @@ class GenerateManifest extends Command {
protected $description = 'Generate the current Git version and commit hash to a manifest';
public function handle() {
+ $staticCommit = (file_exists(base_path('COMMIT')) ? trim(file_get_contents(base_path('COMMIT'))) : env('GITHUB_SHA', ''));
+ $staticVersion = (file_exists(base_path('VERSION')) ? trim(file_get_contents(base_path('VERSION'))) : null);
+
$commit = trim(shell_exec('git rev-parse --short HEAD') ?? '')
- ?: substr(env('GITHUB_SHA', ''), 0, 7)
- ?: (file_exists(base_path('COMMIT')) ? trim(file_get_contents(base_path('COMMIT'))) : null)
+ ?: substr($staticCommit, 0, 7)
?: 'unknown';
$version = trim(shell_exec('git describe --tags --abbrev=0') ?? '')
- ?: (file_exists(base_path('VERSION')) ? trim(file_get_contents(base_path('VERSION'))) : null)
+ ?: substr($staticVersion, 0, 7)
?: env('GITHUB_REF_NAME', 'unknown');
$data = json_encode([