-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
25 lines (21 loc) · 804 Bytes
/
Copy pathstart.sh
File metadata and controls
25 lines (21 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Instala dependencias (si hace falta) e inicia el servidor de desarrollo.
# Si Node no esta en el PATH, npm fallara con un mensaje claro al ejecutarse.
set -e
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"
# Instalar dependencias si no existe node_modules/
if [ ! -d "node_modules" ]; then
echo "Instalando dependencias..."
if ! npm install; then
echo ""
echo "npm install fallo. Verifica que Node.js esté instalado y en el PATH."
echo " nvm: https://github.com/nvm-sh/nvm"
echo " fnm: https://github.com/Schniz/fnm"
echo "Después: nvm install 24 && nvm use 24 (o el equivalente en fnm)"
exit 1
fi
fi
# Iniciar servidor de desarrollo (--open abre el navegador)
echo "Iniciando servidor de desarrollo..."
npx vite --open