mirror of
https://github.com/dw-0/kiauh.git
synced 2026-04-01 07:15:16 +05:00
Compare commits
1 Commits
6178e7100d
...
280358ee5b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
280358ee5b |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
.idea
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
__pycache__
|
|
||||||
.kiauh-env
|
.kiauh-env
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
*.iml
|
*.iml
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ from utils.git_utils import (
|
|||||||
get_remote_commit,
|
get_remote_commit,
|
||||||
git_pull_wrapper,
|
git_pull_wrapper,
|
||||||
)
|
)
|
||||||
|
from utils.input_utils import get_confirm
|
||||||
from utils.logger import Logger
|
from utils.logger import Logger
|
||||||
from utils.sys_utils import (
|
from utils.sys_utils import (
|
||||||
parse_packages_from_file,
|
parse_packages_from_file,
|
||||||
@@ -47,24 +48,6 @@ def install_crowsnest() -> None:
|
|||||||
instances: List[Klipper] = im.find_instances()
|
instances: List[Klipper] = im.find_instances()
|
||||||
|
|
||||||
if len(instances) > 1:
|
if len(instances) > 1:
|
||||||
configure_multi_instance(instances)
|
|
||||||
|
|
||||||
# Step 4: Launch crowsnest installer
|
|
||||||
print(f"{COLOR_CYAN}Installer will prompt you for sudo password!{RESET_FORMAT}")
|
|
||||||
Logger.print_status("Launching crowsnest installer ...")
|
|
||||||
try:
|
|
||||||
run(
|
|
||||||
f"sudo make install BASE_USER={CURRENT_USER}",
|
|
||||||
cwd=CROWSNEST_DIR,
|
|
||||||
shell=True,
|
|
||||||
check=True,
|
|
||||||
)
|
|
||||||
except CalledProcessError as e:
|
|
||||||
Logger.print_error(f"Something went wrong! Please try again...\n{e}")
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def configure_multi_instance(instances: List[Klipper]) -> None:
|
|
||||||
Logger.print_status("Multi instance install detected ...")
|
Logger.print_status("Multi instance install detected ...")
|
||||||
info = textwrap.dedent("""
|
info = textwrap.dedent("""
|
||||||
Crowsnest is NOT designed to support multi instances.
|
Crowsnest is NOT designed to support multi instances.
|
||||||
@@ -78,6 +61,10 @@ def configure_multi_instance(instances: List[Klipper]) -> None:
|
|||||||
|
|
||||||
Logger.print_status("\nLaunching crowsnest's configuration tool ...")
|
Logger.print_status("\nLaunching crowsnest's configuration tool ...")
|
||||||
|
|
||||||
|
if not get_confirm("Continue with configuration?", False, allow_go_back=True):
|
||||||
|
Logger.print_info("Installation aborted by user ... Exiting!")
|
||||||
|
return
|
||||||
|
|
||||||
config = Path(CROWSNEST_DIR).joinpath("tools/.config")
|
config = Path(CROWSNEST_DIR).joinpath("tools/.config")
|
||||||
try:
|
try:
|
||||||
run(
|
run(
|
||||||
@@ -96,6 +83,20 @@ def configure_multi_instance(instances: List[Klipper]) -> None:
|
|||||||
Logger.print_error("Generating .config failed, installation aborted")
|
Logger.print_error("Generating .config failed, installation aborted")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Step 4: Launch crowsnest installer
|
||||||
|
print(f"{COLOR_CYAN}Installer will prompt you for sudo password!{RESET_FORMAT}")
|
||||||
|
Logger.print_status("Launching crowsnest installer ...")
|
||||||
|
try:
|
||||||
|
run(
|
||||||
|
f"sudo make install BASE_USER={CURRENT_USER}",
|
||||||
|
cwd=CROWSNEST_DIR,
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
except CalledProcessError as e:
|
||||||
|
Logger.print_error(f"Something went wrong! Please try again...\n{e}")
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def update_crowsnest() -> None:
|
def update_crowsnest() -> None:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user