Skip to content

Commit 9f027d5

Browse files
committed
NEW | yarninstall.sh
A simple script '.sh' for install yarn on your system.
1 parent f4d2404 commit 9f027d5

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

yarninstall.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Définir les couleurs
4+
GREEN=$(tput setaf 2)
5+
RED=$(tput setaf 1)
6+
BLUE=$(tput setaf 4)
7+
VIOLET=$(tput setaf 5)
8+
BOLD=$(tput bold)
9+
RESET=$(tput sgr0)
10+
########################################## INITIALISATION ROOT ##########################################
11+
12+
# Vérifier si l'utilisateur est root
13+
if [[ $EUID -ne 0 ]]; then
14+
echo "${RED}${BOLD}Ce script doit être exécuté en tant que root${RESET}"
15+
# Demander le mot de passe
16+
sudo "$0" "$@"
17+
exit 1
18+
fi
19+
20+
# Le reste du script ici
21+
22+
########################################## YARN INSTALL ##################################################
23+
24+
# Préparation #
25+
apt-get remote cmdtest
26+
apt-get remove yarn
27+
##
28+
29+
# Ajout de la clé #
30+
echo ""
31+
echo "${GREEN}${BOLD}Ajout de la clé & du répertoire${RESET}"
32+
echo ""
33+
34+
sleep 1
35+
36+
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
37+
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
38+
##
39+
40+
## INSTALLATION DOCKER | Last Version ##
41+
echo ""
42+
echo "${BLUE}${BOLD}Installation de la dernière version de yarn${RESET}"
43+
echo ""
44+
45+
apt-get update
46+
apt-get install yarn -y

0 commit comments

Comments
 (0)