diff options
author | vaxerski <[email protected]> | 2024-04-16 15:41:11 +0100 |
---|---|---|
committer | vaxerski <[email protected]> | 2024-04-16 15:41:11 +0100 |
commit | 9a66514e26319e41c8661f57097a73b1c8579ccf (patch) | |
tree | 03b9b7cb1f83a6e4c9461333ecf768a2b1aced75 /hyprpm | |
parent | 32555e98ddb2f782359b9c550dd4eceb17c3de79 (diff) | |
download | Hyprland-9a66514e26319e41c8661f57097a73b1c8579ccf.tar.gz Hyprland-9a66514e26319e41c8661f57097a73b1c8579ccf.zip |
hyprpm: shallow since a week before commit date
timezones, etc.
ref #5612
Diffstat (limited to 'hyprpm')
-rw-r--r-- | hyprpm/src/core/PluginManager.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hyprpm/src/core/PluginManager.cpp b/hyprpm/src/core/PluginManager.cpp index 6d3da92e..459ee415 100644 --- a/hyprpm/src/core/PluginManager.cpp +++ b/hyprpm/src/core/PluginManager.cpp @@ -401,7 +401,14 @@ bool CPluginManager::updateHeaders(bool force) { progress.printMessageAbove(std::string{Colors::YELLOW} + "!" + Colors::RESET + " Cloning https://github.com/hyprwm/hyprland, this might take a moment."); - std::string ret = execAndGet("cd /tmp/hyprpm && git clone --recursive https://github.com/hyprwm/hyprland hyprland --shallow-since='" + HLVER.date + "'"); + // let us give a bit of leg-room for shallowing + // due to timezones, etc. + const std::string SHALLOW_DATE = removeBeginEndSpacesTabs(HLVER.date).empty() ? "" : execAndGet("date --date='" + HLVER.date + " - 1 weeks' '+\%a \%b \%d \%H:\%M:\%S \%Y'"); + + if (m_bVerbose) + progress.printMessageAbove(std::string{Colors::BLUE} + "[v] " + Colors::RESET + "will shallow since: " + SHALLOW_DATE); + + std::string ret = execAndGet("cd /tmp/hyprpm && git clone --recursive https://github.com/hyprwm/hyprland hyprland --shallow-since='" + SHALLOW_DATE + "'"); if (!std::filesystem::exists("/tmp/hyprpm/hyprland")) { progress.printMessageAbove(std::string{Colors::RED} + "✖" + Colors::RESET + " Clone failed. Retrying without shallow."); |