ladybird/Userland/Libraries/LibCore/Version.cpp
Andreas Kling d0977ac566 LibCore+LibGUI+About: Use String in Core::Version and GUI::AboutDialog
The Core::Version API now returns ErrorOr<String>, and the
GUI::AboutDialog API was adjusted to accommodate this.
2023-03-03 15:23:47 +01:00

23 lines
478 B
C++

/*
* Copyright (c) 2021, Mahmoud Mandour <ma.mandourr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <LibCore/System.h>
#include <LibCore/Version.h>
namespace Core::Version {
ErrorOr<String> read_long_version_string()
{
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);
}
}