LibCore: Add default version for Lagom applications

Instead of grabbing `uname -vr` on non-Serenity platforms, let's just
hardcode a version. This prevents Lagom builds of applications like
Shell or Ladybird from reporting their version as that of the host OS.
This commit is contained in:
Andrew Kaster 2023-08-19 16:31:07 -06:00 committed by Tim Flynn
commit b7f9634f6c
Notes: sideshowbarker 2024-07-17 03:51:15 +09:00
2 changed files with 6 additions and 0 deletions

View file

@ -12,12 +12,16 @@ namespace Core::Version {
ErrorOr<String> read_long_version_string()
{
#ifdef AK_OS_SERENITY
auto uname = TRY(Core::System::uname());
auto const* version = uname.release;
auto const* git_hash = uname.version;
return String::formatted("Version {} revision {}", version, git_hash);
#else
return String::from_utf8("Version 1.0"sv);
#endif
}
}