feature: agrego soporte para apis gitea

This commit is contained in:
jt
2026-07-08 21:12:06 -03:00
parent c93833769b
commit 87c5ba81c4
6 changed files with 82 additions and 31 deletions
+9 -4
View File
@@ -1,6 +1,6 @@
import typer
from git_flow import FLOWCONFIG_FILENAME, GitFlowError
from git_flow import FLOWCONFIG_FILENAME, FLOWCONFIG_VERSION, GitFlowError
from git_flow.git import Git
from git_flow.command.base import *
@@ -15,15 +15,17 @@ def init():
_ensure_not_already_initialized()
branches = _setup_flow_branches()
remote = _setup_flow_remote()
(remote, remote_type) = _setup_flow_remote()
flowconfig = {
"flow.version": str(FLOWCONFIG_VERSION),
"flow.initialized": "true",
"flow.branches": ",".join(branches),
}
if remote:
if remote and remote_type:
flowconfig["flow.remote"] = remote
flowconfig["flow.remote-type"] = remote_type
Git.set_config(flowconfig, FLOWCONFIG_FILENAME)
Git("add", FLOWCONFIG_FILENAME).exec()
@@ -74,6 +76,7 @@ def _setup_flow_remote():
)
remote = None
remote_type = None
if confirm("¿Configurar repositorio remoto?"):
remotes = Git("remote").lines(print="Listando remotos disponibles")
@@ -93,7 +96,9 @@ def _setup_flow_remote():
info("Tiene más de un remoto, seleccione el que va a utilizar.")
remote = choice("Remoto", remotes)
return remote
remote_type = choice("Tipo de remoto:", ["bitbucket", "github", "gitea"])
return (remote, remote_type)
def _ensure_all_flow_branches_exist(branches: list[str], remote: str | None):