hyprpm: check version and update automatically on add (#10706)
ideally should let the user know, but jic also checks for header updates
This commit is contained in:
parent
412c7dc7f7
commit
748419faa5
1 changed files with 10 additions and 0 deletions
|
|
@ -101,9 +101,19 @@ int main(int argc, char** argv, char** envp) {
|
||||||
if (command.size() >= 3)
|
if (command.size() >= 3)
|
||||||
rev = command[2];
|
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();
|
NSys::root::cacheSudo();
|
||||||
CScopeGuard x([] { NSys::root::dropSudo(); });
|
CScopeGuard x([] { NSys::root::dropSudo(); });
|
||||||
|
|
||||||
|
g_pPluginManager->updateHeaders(false);
|
||||||
|
|
||||||
return g_pPluginManager->addNewPluginRepo(command[1], rev) ? 0 : 1;
|
return g_pPluginManager->addNewPluginRepo(command[1], rev) ? 0 : 1;
|
||||||
} else if (command[0] == "remove") {
|
} else if (command[0] == "remove") {
|
||||||
if (command.size() < 2) {
|
if (command.size() < 2) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue