bugfix: commit small improvements #69
@@ -52,15 +52,14 @@ def ensure_initialized():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def ensure_right_branch():
|
def ensure_on_branch():
|
||||||
branch = Git.get_current_branch()
|
branch = Git.get_current_branch()
|
||||||
|
|
||||||
if branch == "HEAD":
|
if branch == "HEAD":
|
||||||
raise GitFlowError("No se encuentra parado sobre una rama.")
|
raise GitFlowError("No se encuentra parado sobre una rama.")
|
||||||
elif io_confirm(f"Rama actual: {branch}. ¿Es correcto?"):
|
|
||||||
return branch
|
io_info(f"Rama actual: {branch}")
|
||||||
else:
|
return branch
|
||||||
raise GitFlowError("Ejecución cancelada.")
|
|
||||||
|
|
||||||
|
|
||||||
def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ app = typer.Typer()
|
|||||||
def commit():
|
def commit():
|
||||||
"""Crea un commit siguiendo el formato de Conventional Commits"""
|
"""Crea un commit siguiendo el formato de Conventional Commits"""
|
||||||
base.ensure_initialized()
|
base.ensure_initialized()
|
||||||
branch = base.ensure_right_branch()
|
branch = base.ensure_on_branch()
|
||||||
|
|
||||||
# Una rama WIP termina squasheando en su rama original, que tampoco puede ser un entorno
|
# Una rama WIP termina squasheando en su rama original, que tampoco puede ser un entorno
|
||||||
target_branch = branch.removeprefix(WIP_BRANCH_PREFIX)
|
target_branch = branch.removeprefix(WIP_BRANCH_PREFIX)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def merge():
|
|||||||
"""Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado"""
|
"""Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado"""
|
||||||
base.ensure_initialized()
|
base.ensure_initialized()
|
||||||
|
|
||||||
branch = base.ensure_right_branch()
|
branch = base.ensure_on_branch()
|
||||||
|
|
||||||
if branch in base.environments:
|
if branch in base.environments:
|
||||||
if branch == base.environments[-1]:
|
if branch == base.environments[-1]:
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def new():
|
|||||||
"""Crea una nueva rama siguiendo Conventional Branches"""
|
"""Crea una nueva rama siguiendo Conventional Branches"""
|
||||||
|
|
||||||
base.ensure_initialized()
|
base.ensure_initialized()
|
||||||
branch = base.ensure_right_branch()
|
branch = base.ensure_on_branch()
|
||||||
|
|
||||||
if branch not in base.environments:
|
if branch not in base.environments:
|
||||||
base.io_warning("La rama actual no corresponde a un entorno configurado.")
|
base.io_warning("La rama actual no corresponde a un entorno configurado.")
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ def release():
|
|||||||
"""Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado"""
|
"""Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado"""
|
||||||
base.ensure_initialized()
|
base.ensure_initialized()
|
||||||
|
|
||||||
branch = base.ensure_right_branch()
|
branch = base.ensure_on_branch()
|
||||||
env, _ = base.get_branch_env_and_type(branch)
|
env, _ = base.get_branch_env_and_type(branch)
|
||||||
|
|
||||||
if env == base.environments[-1]:
|
if env == base.environments[-1]:
|
||||||
|
|||||||
Reference in New Issue
Block a user