def METHOD_NAME(struct: Structure, opts: ScaffoldOpts) -> ActionParams:
    """Attempts to install pre-commit in the project"""
    project_path = opts.get("project_path", "PROJECT_DIR")
    pre_commit = opts.get(CMD_OPT) or shell.get_command(EXECUTABLE, venv.get_path(opts))
    # ^  try again after venv, maybe it was installed
    if pre_commit:
        try:
            with chdir(opts.get("project_path", "."), **opts):
                pre_commit("install", pretend=opts.get("pretend"))
            logger.warning(SUCCESS_MSG)
            return struct, opts
        except ShellCommandException:
            logger.error(ERROR_MSG, exc_info=True)
    logger.warning(INSTALL_MSG.format(project_path=project_path))
    return struct, opts