Version.cpp 478 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (c) 2021, Mahmoud Mandour <ma.mandourr@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/String.h>
  7. #include <LibCore/System.h>
  8. #include <LibCore/Version.h>
  9. namespace Core::Version {
  10. ErrorOr<String> read_long_version_string()
  11. {
  12. auto uname = TRY(Core::System::uname());
  13. auto const* version = uname.release;
  14. auto const* git_hash = uname.version;
  15. return String::formatted("Version {} revision {}", version, git_hash);
  16. }
  17. }