-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
78 lines (66 loc) · 1.93 KB
/
start.sh
File metadata and controls
78 lines (66 loc) · 1.93 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
# TrueEye Quick Start Script
# Este script facilita el uso de TrueEye sin tener que recordar comandos de Nix
set -e
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$PROJECT_DIR"
show_help() {
cat << 'EOF'
🧿 TrueEye - Quick Start Script
USAGE:
./start.sh [COMMAND]
COMMANDS:
start - Iniciar la aplicación (por defecto)
test - Ejecutar tests
config - Editar configuración
help - Mostrar esta ayuda
shell - Abrir shell de desarrollo
EXAMPLES:
./start.sh # Iniciar aplicación
./start.sh test # Ejecutar tests
./start.sh config # Editar .env
REQUIREMENTS:
- NixOS o Nix package manager instalado
- Internet para la primera vez (para descargar dependencias)
La aplicación estará disponible en http://localhost:8000
EOF
}
# Verificar si Nix está instalado
if ! command -v nix-shell >/dev/null 2>&1; then
echo "❌ Error: nix-shell no está instalado"
echo "📦 Instala Nix desde: https://nixos.org/download.html"
exit 1
fi
# Verificar si estamos en el directorio correcto
if [ ! -f "shell.nix" ]; then
echo "❌ Error: No se encontró shell.nix en el directorio actual"
echo "📁 Asegúrate de estar en el directorio del proyecto TrueEye"
exit 1
fi
# Procesar argumentos
case "${1:-start}" in
"start"|"")
echo "🚀 Iniciando TrueEye..."
exec nix-shell --run "trueeye-dev"
;;
"test")
echo "🧪 Ejecutando tests..."
exec nix-shell --run "trueeye-test"
;;
"config")
echo "⚙️ Editando configuración..."
exec nix-shell --run "trueeye-config"
;;
"shell")
echo "🐚 Abriendo shell de desarrollo..."
exec nix-shell
;;
"help"|"-h"|"--help")
show_help
;;
*)
echo "❌ Comando desconocido: $1"
echo "💡 Usa './start.sh help' para ver los comandos disponibles"
exit 1
;;
esac