mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
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:
parent
39e79d6f6f
commit
b7f9634f6c
Notes:
sideshowbarker
2024-07-17 03:51:15 +09:00
Author: https://github.com/ADKaster
Commit: b7f9634f6c
Pull-request: https://github.com/SerenityOS/serenity/pull/20672
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/trflynn89
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue