-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·56 lines (43 loc) · 1.5 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·56 lines (43 loc) · 1.5 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
#!/bin/bash
echo "🔧 Installation ou mise à jour de Sendgit"
echo ""
# Déterminer le choix : argument ou prompt
if [[ "$1" == "1" || "$1" == "2" ]]; then
choice=$1
else
echo "Tu es sur quel type de système ?"
echo "1) PC (Linux/macOS)"
echo "2) Android (Termux)"
read -p "👉 Tape 1 ou 2 : " choice
fi
if [ "$choice" == "1" ]; then
echo ""
echo "🖥️ Mise à jour pour Linux/macOS..."
# Télécharger la dernière version
curl -L https://raw.githubusercontent.com/hasprogamer/Sendgit/main/github.sh -o /tmp/sendgit
# Rendre exécutable
chmod +x /tmp/sendgit
# Déplacer le script
sudo mv /tmp/sendgit /usr/local/bin/sendgit
echo "✅ Sendgit est installé. Tu peux l’utiliser avec : sendgit"
elif [ "$choice" == "2" ]; then
echo ""
echo "📱 Mise à jour pour Termux (Android)..."
mkdir -p ~/bin
curl -L https://raw.githubusercontent.com/hasprogamer/Sendgit/main/github.sh -o ~/bin/sendgit.sh
chmod +x ~/bin/sendgit.sh
# Ajouter ~/bin au PATH si nécessaire
if ! echo $PATH | grep -q "$HOME/bin"; then
echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc
export PATH=$HOME/bin:$PATH
fi
# Créer alias si absent
if ! grep -q 'alias sendgit=' ~/.bashrc; then
echo 'alias sendgit="bash ~/bin/sendgit.sh"' >> ~/.bashrc
source ~/.bashrc
fi
echo "✅ Sendgit est installé. Tu peux l’utiliser avec : sendgit"
else
echo "❌ Choix invalide. Recommence et tape 1 ou 2."
exit 1
fi