(context: Context)
Configures Bento to NOT run automatically on commits.

    Autorun is only removed for the project from which this
    command is run.
Configures Bento to NOT run automatically on commits.
Configures Bento to NOT run automatically on commits .
def uninstall_autorun(context: Context) -> None:
    """
    Configures Bento to NOT run automatically on commits.

    Autorun is only removed for the project from which this
    command is run.
    """
    import git  # import inside def for performance

    # Get hook path
    repo = bento.git.repo(context.base_path)
    if repo is None:
        raise NotAGitRepoException()

    hook_path = Path(git.index.fun.hook_path("pre-commit", repo.git_dir))

    if not _is_bento_precommit(hook_path):
        echo_warning(
            "Not uninstalling autorun: Bento is not configured for autorun on this project."
        )
        sys.exit(1)
    else:
        # Put back legacy hook if exits
        legacy_hook_path = Path(f"{hook_path}.pre-bento")
        if legacy_hook_path.exists():
            shutil.move(str(legacy_hook_path), str(hook_path))
        else:
            hook_path.unlink()

        echo_success("Uninstalled Bento autorun.")
        echo_next_step("To enable autorun", "bento enable autorun")
def uninstall_autorun ( context : Context ) -> None : import git # import inside def for performance # Get hook path repo = bento . git . repo ( context . base_path ) if repo is None : raise NotAGitRepoException ( ) hook_path = Path ( git . index . fun . hook_path ( "pre-commit" , repo . git_dir ) ) if not _is_bento_precommit ( hook_path ) : echo_warning ( "Not uninstalling autorun: Bento is not configured for autorun on this project." ) sys . exit ( 1 ) else : # Put back legacy hook if exits legacy_hook_path = Path ( f"{hook_path}.pre-bento" ) if legacy_hook_path . exists ( ) : shutil . move ( str ( legacy_hook_path ) , str ( hook_path ) ) else : hook_path . unlink ( ) echo_success ( "Uninstalled Bento autorun." ) echo_next_step ( "To enable autorun" , "bento enable autorun" )