feature: agrego soporte para apis gitea
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user