mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 18:26:00 +01:00
hyprpm: don't shallow clone on non-main branches
This commit is contained in:
parent
42df58fc06
commit
af5a987080
1 changed files with 7 additions and 3 deletions
|
@ -442,14 +442,18 @@ bool CPluginManager::updateHeaders(bool force) {
|
||||||
|
|
||||||
progress.printMessageAbove(std::string{Colors::YELLOW} + "!" + Colors::RESET + " Cloning https://github.com/hyprwm/hyprland, this might take a moment.");
|
progress.printMessageAbove(std::string{Colors::YELLOW} + "!" + Colors::RESET + " Cloning https://github.com/hyprwm/hyprland, this might take a moment.");
|
||||||
|
|
||||||
|
const bool bShallow = HLVER.branch == "main" || HLVER.branch == "";
|
||||||
|
|
||||||
// let us give a bit of leg-room for shallowing
|
// let us give a bit of leg-room for shallowing
|
||||||
// due to timezones, etc.
|
// due to timezones, etc.
|
||||||
const std::string SHALLOW_DATE = removeBeginEndSpacesTabs(HLVER.date).empty() ? "" : execAndGet("LC_TIME=\"en_US.UTF-8\" date --date='" + HLVER.date + " - 1 weeks' '+\%a \%b \%d \%H:\%M:\%S \%Y'");
|
const std::string SHALLOW_DATE =
|
||||||
|
removeBeginEndSpacesTabs(HLVER.date).empty() ? "" : execAndGet("LC_TIME=\"en_US.UTF-8\" date --date='" + HLVER.date + " - 1 weeks' '+\%a \%b \%d \%H:\%M:\%S \%Y'");
|
||||||
|
|
||||||
if (m_bVerbose)
|
if (m_bVerbose && bShallow)
|
||||||
progress.printMessageAbove(std::string{Colors::BLUE} + "[v] " + Colors::RESET + "will shallow since: " + SHALLOW_DATE);
|
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-" + USERNAME + " --shallow-since='" + SHALLOW_DATE + "'");
|
std::string ret =
|
||||||
|
execAndGet("cd /tmp/hyprpm && git clone --recursive https://github.com/hyprwm/hyprland hyprland-" + USERNAME + (bShallow ? " --shallow-since='" + SHALLOW_DATE + "'" : ""));
|
||||||
|
|
||||||
if (!std::filesystem::exists(WORKINGDIR)) {
|
if (!std::filesystem::exists(WORKINGDIR)) {
|
||||||
progress.printMessageAbove(std::string{Colors::RED} + "✖" + Colors::RESET + " Clone failed. Retrying without shallow.");
|
progress.printMessageAbove(std::string{Colors::RED} + "✖" + Colors::RESET + " Clone failed. Retrying without shallow.");
|
||||||
|
|
Loading…
Reference in a new issue