-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtrigger.sh
56 lines (45 loc) · 1.64 KB
/
trigger.sh
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
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[1;32m'
CYAN='\033[1;36m'
NC='\033[0m'
echo -e "${CYAN}========================="
echo "next-i18next Expansion"
echo "========================="
echo -e "${NC}"
#region //*=========== Install Packages ===========
echo -e "${NC}"
echo -e "${GREEN}[Step 1] Installing additional packages${NC}"
echo ""
echo -e "Packages: ${GREEN}next-i18next i18next react-i18next"
echo -e "${NC}"
yarn add next-i18next i18next react-i18next
# endregion //*======== Install Packages ===========
#region //*=========== Create Directories ===========
mkdir -p public/locales/en
mkdir -p public/locales/id
#endregion //*======== Create Directories ===========
#region //*=========== Downloading Files ===========
echo ""
echo -e "${GREEN}[Step 2] Downloading files${NC}"
echo ""
DIRNAME="next-i18next"
files=(
"src/pages/next-i18next-_app.tsx"
"src/pages/next-i18next-example.tsx"
"public/locales/en/common.json"
"public/locales/id/common.json"
"next-i18next.config.js"
"next.config.expansion.js"
)
for i in "${files[@]}"
do
echo "Downloading... $i"
curl -LJs -o $i https://raw.githubusercontent.com/theodorusclarence/expansion-pack/main/$DIRNAME/$i
done
#endregion //*======== Downloading Files ===========
echo ""
echo -e "${CYAN}============================================"
echo "🔋 next-i18next Expansion Completed"
echo -e "${RED}REQUIRED ACTIONS${NC} update '_app.tsx' component with the content of 'src/pages/next-i18next-_app.tsx' manually to avoid conflicts${CYAN}"
echo -e "${RED}REQUIRED ACTIONS${NC} update main 'next.config.js' with the content of next.config.expansion.js manually to avoid conflicts${CYAN}"