Commit e1aafc3c authored by Andres Anaya Amariels's avatar Andres Anaya Amariels 🚀
Browse files

fix: improve dependency installation logic in run_full_capif_sdk.sh

parent f4c7d2b0
Loading
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -11,9 +11,28 @@ LOG_FILE="/tmp/capif_setup.log"


# === Ensure required tools are installed ===
echo "📦 Installing dependencies (git + jq)..."
apt-get update -y
apt-get install -y git jq
echo "📦 Checking dependencies (git + jq)..."

missing=()
for bin in git jq; do
  if ! command -v "$bin" >/dev/null 2>&1; then
    missing+=("$bin")
  fi
done

if [ ${#missing[@]} -gt 0 ]; then
  echo "📦 Installing missing packages: ${missing[*]} ..."
  if [ "$EUID" -ne 0 ]; then
    sudo apt-get update -y
    sudo apt-get install -y "${missing[@]}"
  else
    sudo apt-get update -y
    sudo apt-get install -y "${missing[@]}"
  fi
else
  echo "✅ git and jq are already installed."
fi


echo "🚀 [1/5] Preparing temporary environment for CAPIF at $CAPIF_DIR..."
rm -rf "$CAPIF_DIR"