mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-24 18:45:59 +01:00
hyprpm: add --no-shallow
This commit is contained in:
parent
908bec1564
commit
1f5fd7e64a
3 changed files with 10 additions and 5 deletions
|
@ -427,7 +427,7 @@ 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 == "";
|
const bool bShallow = (HLVER.branch == "main" || HLVER.branch == "") && !m_bNoShallow;
|
||||||
|
|
||||||
// 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.
|
||||||
|
|
|
@ -58,7 +58,8 @@ class CPluginManager {
|
||||||
|
|
||||||
bool hasDeps();
|
bool hasDeps();
|
||||||
|
|
||||||
bool m_bVerbose = false;
|
bool m_bVerbose = false;
|
||||||
|
bool m_bNoShallow = false;
|
||||||
|
|
||||||
// will delete recursively if exists!!
|
// will delete recursively if exists!!
|
||||||
bool createSafeDirectory(const std::string& path);
|
bool createSafeDirectory(const std::string& path);
|
||||||
|
|
|
@ -26,6 +26,7 @@ const std::string HELP = R"#(┏ hyprpm, a Hyprland Plugin Manager
|
||||||
┣ --help | -h → Show this menu
|
┣ --help | -h → Show this menu
|
||||||
┣ --verbose | -v → Enable too much logging
|
┣ --verbose | -v → Enable too much logging
|
||||||
┣ --force | -f → Force an operation ignoring checks (e.g. update -f)
|
┣ --force | -f → Force an operation ignoring checks (e.g. update -f)
|
||||||
|
┣ --no-shallow | -s → Disable shallow cloning of Hyprland sources
|
||||||
┗
|
┗
|
||||||
)#";
|
)#";
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ int main(int argc, char** argv, char** envp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> command;
|
std::vector<std::string> command;
|
||||||
bool notify = false, verbose = false, force = false;
|
bool notify = false, verbose = false, force = false, noShallow = false;
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
if (ARGS[i].starts_with("-")) {
|
if (ARGS[i].starts_with("-")) {
|
||||||
|
@ -52,6 +53,8 @@ int main(int argc, char** argv, char** envp) {
|
||||||
notify = true;
|
notify = true;
|
||||||
} else if (ARGS[i] == "--verbose" || ARGS[i] == "-v") {
|
} else if (ARGS[i] == "--verbose" || ARGS[i] == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
} else if (ARGS[i] == "--no-shallow" || ARGS[i] == "-s") {
|
||||||
|
noShallow = true;
|
||||||
} else if (ARGS[i] == "--force" || ARGS[i] == "-f") {
|
} else if (ARGS[i] == "--force" || ARGS[i] == "-f") {
|
||||||
force = true;
|
force = true;
|
||||||
std::cout << Colors::RED << "!" << Colors::RESET << " Using --force, I hope you know what you are doing.\n";
|
std::cout << Colors::RED << "!" << Colors::RESET << " Using --force, I hope you know what you are doing.\n";
|
||||||
|
@ -69,8 +72,9 @@ int main(int argc, char** argv, char** envp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pPluginManager = std::make_unique<CPluginManager>();
|
g_pPluginManager = std::make_unique<CPluginManager>();
|
||||||
g_pPluginManager->m_bVerbose = verbose;
|
g_pPluginManager->m_bVerbose = verbose;
|
||||||
|
g_pPluginManager->m_bNoShallow = noShallow;
|
||||||
|
|
||||||
if (command[0] == "add") {
|
if (command[0] == "add") {
|
||||||
if (command.size() < 2) {
|
if (command.size() < 2) {
|
||||||
|
|
Loading…
Reference in a new issue