#!/bin/bash

# 🚀 Script de Configuração RHEL/DNF - PraFrota FE

set -e

echo "Iniciando instalação para RHEL/Fedora/CentOS..."

# Bases
sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y git curl

# NVM e Node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

nvm install 20.12.0
nvm use 20.12.0

# Projeto
npm install --legacy-peer-deps
npm run build libs

echo "✅ Pronto!"
