-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinstall.sh
68 lines (51 loc) · 1.81 KB
/
install.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
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
echo "Copying .env-general-example to .env-general..."
cp .env-general-example .env-general
echo "Copying .env-blum-example to .env-blum..."
cp .env-blum-example .env-blum
echo "Copying .env-tomarket-example to .env-tomarket..."
cp .env-tomarket-example .env-tomarket
echo "Copying .env-rockyrabbit-example to .env-rockyrabbit..."
cp .env-rockyrabbit-example .env-rockyrabbit
echo "Copying .env-timefarm-example to .env-timefarm..."
cp .env-timefarm-example .env-timefarm
echo "Copying .env-dotcoin-example to .env-dotcoin..."
cp .env-dotcoin-example .env-dotcoin
echo "Copying .env-lostdogs-example to .env-lostdogs..."
cp .env-lostdogs-example .env-lostdogs
echo "Copying .env-major-example to .env-major..."
cp .env-major-example .env-major
echo "Copying .env-pocketfi-example to .env-pocketfi..."
cp .env-pocketfi-example .env-pocketfi
echo "Please edit the .env-general file to add your API_ID and API_HASH after Installation."
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check if Node.js is installed
if command_exists node; then
echo "Preparing to install npm packages..."
else
echo "Node.js is not installed. Installing Node.js..."
# Install Node.js 18 (This assumes a Debian-based system like Ubuntu)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify installation
if command_exists node; then
echo "Node.js successfully installed."
else
echo "Failed to install Node.js. Exiting."
exit 1
fi
fi
# Install npm packages
echo "Installing npm packages..."
npm install
# Verify installation of npm packages
if [ $? -eq 0 ]; then
echo "npm packages successfully installed."
else
echo "Failed to install npm packages. Exiting."
exit 1
fi
read -p "Press any key to continue..."