summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluisgulo <luisgulo@gmail.com>2025-11-06 18:02:05 +0100
committerluisgulo <luisgulo@gmail.com>2025-11-06 18:02:05 +0100
commita29ff9acd24ab3b6fc2012cf6da664909afae618 (patch)
treefa4db562895d5b02ee4927b0553f80887344bd3f
parent6dfbad1caf1a7740ef9eb5155e2acd33f3228a35 (diff)
YQ_BIN in shflow-check
-rwxr-xr-xcore/utils/shflow-check.sh13
-rwxr-xr-xshflow.sh4
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
diff --git a/shflow.sh b/shflow.sh
index 465eba5..a5fb993 100755
--- a/shflow.sh
+++ b/shflow.sh
@@ -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"