mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-25 08:43:36 +05:00
Compare commits
5 Commits
develop-do
...
51393b5f59
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51393b5f59 | ||
|
|
41d3d749b0 | ||
|
|
2d4c952b4b | ||
|
|
d5119bc264 | ||
|
|
8cb66071ac |
@@ -176,6 +176,9 @@ def install_klipper_packages() -> None:
|
||||
script = KLIPPER_INSTALL_SCRIPT
|
||||
packages = parse_packages_from_file(script)
|
||||
|
||||
# Add pkg-config for rp2040 build
|
||||
packages.append("pkg-config")
|
||||
|
||||
# Add dbus requirement for DietPi distro
|
||||
if Path("/boot/dietpi/.version").exists():
|
||||
packages.append("dbus")
|
||||
|
||||
@@ -253,9 +253,29 @@ def get_remote_commit(repo: Path) -> str | None:
|
||||
return None
|
||||
|
||||
|
||||
def git_cmd_clone(repo: str, target_dir: Path) -> None:
|
||||
def git_cmd_clone(repo: str, target_dir: Path, depth: int = 0, single_branch: bool = False) -> None:
|
||||
"""
|
||||
Clones a repository with optional depth and single-branch parameters.
|
||||
|
||||
:param repo: URL of the repository to clone.
|
||||
:param target_dir: Path where the repository will be cloned.
|
||||
:param depth: Clone depth. If 0, the depth option will be omitted.
|
||||
:param single_branch: Clone only a single branch if True.
|
||||
:return: None
|
||||
"""
|
||||
try:
|
||||
command = ["git", "clone", repo, target_dir.as_posix()]
|
||||
command = ["git", "clone"]
|
||||
|
||||
# Add --depth flag if depth > 0
|
||||
if depth > 0:
|
||||
command += ["--depth", str(depth)]
|
||||
|
||||
# Add --single-branch flag if single_branch is True
|
||||
if single_branch:
|
||||
command.append("--single-branch")
|
||||
|
||||
command += [repo, target_dir.as_posix()]
|
||||
|
||||
run(command, check=True)
|
||||
|
||||
Logger.print_ok("Clone successful!")
|
||||
|
||||
@@ -304,6 +304,8 @@ function install_klipper_packages() {
|
||||
packages=$(grep "PKGLIST=" "${install_script}" | cut -d'"' -f2 | sed 's/\${PKGLIST}//g' | tr -d '\n')
|
||||
### add dfu-util for octopi-images
|
||||
packages+=" dfu-util"
|
||||
### add pkg-config for rp2040 build
|
||||
packages+=" pkg-config"
|
||||
### add dbus requirement for DietPi distro
|
||||
[[ -e "/boot/dietpi/.version" ]] && packages+=" dbus"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user