feat(commands,bash): estandarizar todos los apps y analyses como dataforge/<name>

- /full-git-push y /full-git-pull descubren apps/analyses sin .git y los
  inicializan/clonan automaticamente contra dataforge/<basename>.
- ensure_repo_synced.sh: localizar gitea_create_repo.sh / gitea_push_directory.sh
  via FN_REGISTRY_INFRA_DIR o FN_REGISTRY_ROOT (mas robusto al sourcing
  desde directorios arbitrarios y desde zsh).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-28 22:18:20 +02:00
parent 424e913566
commit 9aaf336c1a
3 changed files with 72 additions and 10 deletions
+18 -2
View File
@@ -38,8 +38,24 @@ ensure_repo_synced() {
return 1
fi
local script_dir
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Localizar las funciones companeras: por env var o por path relativo al
# propio script si esta disponible.
local script_dir="${FN_REGISTRY_INFRA_DIR:-}"
if [[ -z "$script_dir" ]]; then
local self="${BASH_SOURCE[0]:-$0}"
if [[ -f "$self" ]]; then
script_dir="$(cd "$(dirname "$self")" && pwd)"
fi
fi
if [[ -z "$script_dir" || ! -f "$script_dir/gitea_create_repo.sh" ]]; then
# Fallback: buscar en FN_REGISTRY_ROOT/bash/functions/infra
local root="${FN_REGISTRY_ROOT:-$(cd "$(pwd)" && while [[ "$PWD" != "/" && ! -f "registry.db" ]]; do cd ..; done && pwd)}"
script_dir="$root/bash/functions/infra"
fi
if [[ ! -f "$script_dir/gitea_create_repo.sh" ]]; then
echo "ensure_repo_synced: no encuentro gitea_create_repo.sh (script_dir=$script_dir). Setea FN_REGISTRY_INFRA_DIR" >&2
return 1
fi
# shellcheck source=./gitea_create_repo.sh
source "$script_dir/gitea_create_repo.sh"
# shellcheck source=./gitea_push_directory.sh