diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-06-12 13:40:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-12 13:40:55 +0200 |
| commit | 748419faa558940dca03a41d09fcc9bb2e1f2106 (patch) | |
| tree | 2f34417b48f3324100b5a00233ac9b425a1b37f7 /hyprpm | |
| parent | 412c7dc7f79cb6b04af41692504e82d4417e6e13 (diff) | |
hyprpm: check version and update automatically on add (#10706)
ideally should let the user know, but jic also checks for header updates
Diffstat (limited to 'hyprpm')
| -rw-r--r-- | hyprpm/src/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hyprpm/src/main.cpp b/hyprpm/src/main.cpp index c8b3bce0..47a557e2 100644 --- a/hyprpm/src/main.cpp +++ b/hyprpm/src/main.cpp @@ -101,9 +101,19 @@ int main(int argc, char** argv, char** envp) { if (command.size() >= 3) rev = command[2]; + const auto HLVER = g_pPluginManager->getHyprlandVersion(); + auto GLOBALSTATE = DataState::getGlobalState(); + + if (GLOBALSTATE.headersHashCompiled != HLVER.hash) { + std::println(stderr, "{}", failureString("Headers outdated, please run hyprpm update.")); + return 1; + } + NSys::root::cacheSudo(); CScopeGuard x([] { NSys::root::dropSudo(); }); + g_pPluginManager->updateHeaders(false); + return g_pPluginManager->addNewPluginRepo(command[1], rev) ? 0 : 1; } else if (command[0] == "remove") { if (command.size() < 2) { |
