mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-25 08:43:36 +05:00
feat: OctoEverywhere for KIAUH v6 (#485)
* feat: scaffold OE installer Signed-off-by: Dominik Willner <th33xitus@gmail.com> * refactor: remove redundant steps ocoeverywhere already takes care of Signed-off-by: Dominik Willner <th33xitus@gmail.com> * refactor: add padding option to dialog Signed-off-by: Dominik Willner <th33xitus@gmail.com> * refactor: oe uninstaller Signed-off-by: Dominik Willner <th33xitus@gmail.com> * fix: add recursive removal of files Signed-off-by: Dominik Willner <th33xitus@gmail.com> * refactor: implement octoeverywhere update Signed-off-by: Dominik Willner <th33xitus@gmail.com> * chore: cleanup Signed-off-by: Dominik Willner <th33xitus@gmail.com> * chore: remove unused argument Signed-off-by: Dominik Willner <th33xitus@gmail.com> * fix: add instance names to blacklist Signed-off-by: Dominik Willner <th33xitus@gmail.com> * refactor: use update.sh script of OctoEverywhere for updating Signed-off-by: Dominik Willner <th33xitus@gmail.com> * fix: typo Signed-off-by: Dominik Willner <th33xitus@gmail.com> * refactor: add force flag to git_clone_wrapper Signed-off-by: Dominik Willner <th33xitus@gmail.com> --------- Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@ from utils.logger import Logger
|
||||
|
||||
|
||||
def git_clone_wrapper(
|
||||
repo: str, target_dir: Path, branch: Optional[str] = None
|
||||
repo: str, target_dir: Path, branch: Optional[str] = None, force: bool = False
|
||||
) -> None:
|
||||
"""
|
||||
Clones a repository from the given URL and checks out the specified branch if given.
|
||||
@@ -22,6 +22,7 @@ def git_clone_wrapper(
|
||||
:param repo: The URL of the repository to clone.
|
||||
:param branch: The branch to check out. If None, the default branch will be checked out.
|
||||
:param target_dir: The directory where the repository will be cloned.
|
||||
:param force: Force the cloning of the repository even if it already exists.
|
||||
:return: None
|
||||
"""
|
||||
log = f"Cloning repository from '{repo}'"
|
||||
@@ -29,7 +30,7 @@ def git_clone_wrapper(
|
||||
try:
|
||||
if Path(target_dir).exists():
|
||||
question = f"'{target_dir}' already exists. Overwrite?"
|
||||
if not get_confirm(question, default_choice=False):
|
||||
if not force and not get_confirm(question, default_choice=False):
|
||||
Logger.print_info("Skip cloning of repository ...")
|
||||
return
|
||||
shutil.rmtree(target_dir)
|
||||
|
||||
Reference in New Issue
Block a user