hyprpm: Make sure we're in git repo before getting new hash (#4303)

This commit is contained in:
zakk4223 2023-12-30 09:19:53 -05:00 committed by GitHub
parent 2ad2e1d5f5
commit 33fe3a2e7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -550,7 +550,7 @@ bool CPluginManager::updatePlugins(bool forceUpdateAll) {
newrepo.plugins.clear();
execAndGet(
"cd /tmp/hyprpm/update/ && git pull --recurse-submodules && git reset --hard --recurse-submodules"); // repo hash in the state.toml has to match head and not any pin
std::string repohash = execAndGet("git rev-parse HEAD");
std::string repohash = execAndGet("cd /tmp/hyprpm/update && git rev-parse HEAD");
if (repohash.length() > 0)
repohash.pop_back();
newrepo.hash = repohash;
@ -721,4 +721,4 @@ std::string CPluginManager::headerError(const eHeadersErrors err) {
}
return std::string{Colors::RED} + "" + Colors::RESET + " Unknown header error. Please run hyprpm update to fix those.\n";
}
}