mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-30 03:03:37 +05:00
Compare commits
4 Commits
v6.0.0-alp
...
93ab78a88f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93ab78a88f | ||
|
|
3963d1174d | ||
|
|
a272bf7e41 | ||
|
|
41d3d749b0 |
@@ -40,7 +40,6 @@ from core.submodules.simple_config_parser.src.simple_config_parser.simple_config
|
|||||||
)
|
)
|
||||||
from core.types.component_status import ComponentStatus
|
from core.types.component_status import ComponentStatus
|
||||||
from utils.common import check_install_dependencies, get_install_status
|
from utils.common import check_install_dependencies, get_install_status
|
||||||
from utils.fs_utils import check_file_exist
|
|
||||||
from utils.input_utils import get_confirm, get_number_input, get_string_input
|
from utils.input_utils import get_confirm, get_number_input, get_string_input
|
||||||
from utils.instance_utils import get_instances
|
from utils.instance_utils import get_instances
|
||||||
from utils.sys_utils import cmd_sysctl_service, parse_packages_from_file
|
from utils.sys_utils import cmd_sysctl_service, parse_packages_from_file
|
||||||
@@ -207,7 +206,7 @@ def install_klipper_packages() -> None:
|
|||||||
packages.append("pkg-config")
|
packages.append("pkg-config")
|
||||||
|
|
||||||
# Add dbus requirement for DietPi distro
|
# Add dbus requirement for DietPi distro
|
||||||
if check_file_exist(Path("/boot/dietpi/.version")):
|
if Path("/boot/dietpi/.version").exists():
|
||||||
packages.append("dbus")
|
packages.append("dbus")
|
||||||
|
|
||||||
check_install_dependencies({*packages})
|
check_install_dependencies({*packages})
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
# ======================================================================= #
|
# ======================================================================= #
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -30,15 +29,15 @@ def check_file_exist(file_path: Path, sudo=False) -> bool:
|
|||||||
:return: True, if file exists, otherwise False
|
:return: True, if file exists, otherwise False
|
||||||
"""
|
"""
|
||||||
if sudo:
|
if sudo:
|
||||||
command = ["sudo", "find", file_path.as_posix()]
|
|
||||||
try:
|
try:
|
||||||
|
command = ["sudo", "find", file_path.as_posix()]
|
||||||
check_output(command, stderr=DEVNULL)
|
check_output(command, stderr=DEVNULL)
|
||||||
return True
|
return True
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if os.access(file_path, os.F_OK):
|
if file_path.exists():
|
||||||
return file_path.exists()
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user