diff options
| -rwxr-xr-x | core/utils/shflow-check.sh | 13 | ||||
| -rwxr-xr-x | shflow.sh | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/core/utils/shflow-check.sh b/core/utils/shflow-check.sh index 130eca0..d026875 100755 --- a/core/utils/shflow-check.sh +++ b/core/utils/shflow-check.sh @@ -20,7 +20,17 @@ if ! declare -f render_msg &>/dev/null; then [[ -f "$COMMON_LIB" ]] && source "$COMMON_LIB" fi -GLOBAL_TOOLS=("bash" "ssh" "scp" "git" "curl" "jq" "yq" "gpg") +# 🔧 yq segun arquitectura +ARCH=$(uname -m) +case "$ARCH" in + x86_64) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_amd64" ;; + i686|i386) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_386" ;; + aarch64) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_arm64" ;; + armv7l|armv6l) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_arm" ;; + *) echo "❌ Arquitectura no soportada: $ARCH"; exit 1 ;; +esac + +GLOBAL_TOOLS=("bash" "ssh" "scp" "git" "curl" "jq" "$YQ_BIN" "gpg") REQUIRED_PATHS=( "$PROJECT_ROOT/core/modules" @@ -47,6 +57,7 @@ check_global_tools() { echo "$(render_msg "${tr[tool_missing]}" "tool=$tool")" missing=1 else + tool=$(basename $tool) echo "$(render_msg "${tr[tool_ok]}" "tool=$tool")" fi done @@ -12,7 +12,7 @@ INVENTORY="$PROJECT_ROOT/core/inventory/hosts.yaml" VAULT_DIR="$PROJECT_ROOT/core/vault" VAULT_KEY="${VAULT_KEY:-$HOME/.shflow.key}" -# Yq segun arquitectura +# 🔧 yq segun arquitectura ARCH=$(uname -m) case "$ARCH" in x86_64) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_amd64" ;; @@ -20,7 +20,7 @@ case "$ARCH" in aarch64) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_arm64" ;; armv7l|armv6l) YQ_BIN="$PROJECT_ROOT/core/utils/yq_linux_arm" ;; *) echo "❌ Arquitectura no soportada: $ARCH"; exit 1 ;; - esac +esac # 🌐 Cargar render_msg y traducciones COMMON_LIB="$PROJECT_ROOT/core/lib/translate_msg.sh" |
