-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnitflex.sh
More file actions
executable file
·80 lines (67 loc) · 1.09 KB
/
nitflex.sh
File metadata and controls
executable file
·80 lines (67 loc) · 1.09 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
79
80
#!/bin/bash
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
help() {
echo -e "${BLUE}Nitflex - Interface de Gestion${NC}"
echo "================================="
echo ""
echo "Usage: $0 [command]"
echo ""
echo -e "${YELLOW}Commandes:${NC}"
echo " update Mise à jour du projet"
echo " format Formatage du code"
echo " dev Lancement en mode développeur"
echo " deploy Lancement en mode production"
echo " help Afficher cette aide"
echo ""
}
format() {
echo -e "${BLUE}🎨 Formatage du code...${NC}"
cd app
npm run format
cd ../api
go fmt ./utils
go fmt ./handlers
go fmt ./
cd ../
}
update() {
git pull origin main
}
deploy() {
chmod +x scripts/setup.sh
./scripts/setup.sh
}
dev() {
chmod +x scripts/setup_dev.sh
./scripts/setup_dev.sh
}
# Main command handling
case "$1" in
"deploy")
deploy
;;
"dev")
dev
;;
"format")
format
;;
"update")
update
;;
"help"|"--help"|"-h"|"")
help
;;
*)
echo -e "${RED}❌ Commande inconnue: '$1'${NC}"
echo ""
help
exit 1
;;
esac