v1.0.0: añade --version, empaqueta release tar.gz, elimina wrapper
This commit is contained in:
+14
-1
@@ -16,6 +16,8 @@ from rich.prompt import Prompt
|
||||
from rich.table import Table
|
||||
from rich.text import Text
|
||||
|
||||
__version__ = "1.0.0"
|
||||
|
||||
console = Console()
|
||||
|
||||
|
||||
@@ -211,13 +213,16 @@ HELP = """[bold]Comandos:[/bold]
|
||||
[cyan]refresh[/cyan] / [cyan]r[/cyan] Re-escanea haciendo git fetch
|
||||
[cyan]update <repo>[/cyan] git pull --ff-only en ese repo (acepta nº, nombre o trozo)
|
||||
[cyan]update all[/cyan] Actualiza todos los que estén behind
|
||||
[cyan]version[/cyan] / [cyan]v[/cyan] Muestra la versión
|
||||
[cyan]help[/cyan] / [cyan]?[/cyan] Esta ayuda
|
||||
[cyan]quit[/cyan] / [cyan]q[/cyan] Salir (también Ctrl-D / Ctrl-C)
|
||||
"""
|
||||
|
||||
|
||||
def repl(base: Path) -> None:
|
||||
console.print(f"[dim]gitswarm — escaneando[/dim] [bold]{base}[/bold]")
|
||||
console.print(
|
||||
f"[dim]gitswarm v{__version__} — escaneando[/dim] [bold]{base}[/bold]"
|
||||
)
|
||||
repos = scan(base, fetch=True)
|
||||
if not repos:
|
||||
console.print(f"[yellow]No se han encontrado repos git en {base}[/yellow]")
|
||||
@@ -245,6 +250,8 @@ def repl(base: Path) -> None:
|
||||
console.print(HELP)
|
||||
elif cmd in ("list", "ls"):
|
||||
console.print(render_table(repos))
|
||||
elif cmd in ("version", "v"):
|
||||
console.print(f"gitswarm v{__version__}")
|
||||
elif cmd in ("refresh", "r"):
|
||||
repos = scan(base, fetch=True)
|
||||
console.print(render_table(repos))
|
||||
@@ -262,6 +269,12 @@ def main() -> int:
|
||||
prog="gitswarm",
|
||||
description="Lista y actualiza repos git de primer nivel en una carpeta.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--version",
|
||||
action="version",
|
||||
version=f"gitswarm v{__version__}",
|
||||
)
|
||||
parser.add_argument("path", type=Path, help="Carpeta a escanear")
|
||||
args = parser.parse_args()
|
||||
if not args.path.is_dir():
|
||||
|
||||
Reference in New Issue
Block a user