-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdependenciesinstaller.sh
61 lines (48 loc) · 1.17 KB
/
dependenciesinstaller.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
#!/bin/bash
# Detect the OS
OS=$(uname -s)
# Determine the correct rc file
if [[ -n "$ZSH_VERSION" ]]; then
RC_FILE=".zshrc"
else
RC_FILE=".bashrc"
fi
# Explicitly source the rc file
source ~/$RC_FILE
# Install nvm
if [[ "$OS" == "Darwin" ]]; then
brew install nvm
elif [[ "$OS" == "Linux" ]]; then
sudo apt -y update
sudo apt -y install zip iptables-persistent
# Check if nvm is already installed
if [[ ! -d "NVM_DIR" ]]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
else
echo "nvm is already installed."
source $NVM_DIR/nvm.sh
fi
fi
# Source the rc file to apply changes
source ~/$RC_FILE
# Install Node.js
nvm install v20.18.1
# Step 4: Install yarn
npm install -g yarn
# Install SDKMAN!
# Check if SDKMAN! is already installed
if [[ ! -d "$SDKMAN_DIR" ]]; then
curl -s "https://get.sdkman.io" | bash
else
echo "SDKMAN! is already installed."
source $SDKMAN_DIR/bin/sdkman-init.sh
fi
# Source the rc file to apply changes
source ~/$RC_FILE
# Install Java
sdk install java 21.0.5-tem
# Source the rc file to apply changes
source ~/$RC_FILE
# Install Gradle
sdk install gradle
echo "Installation complete!"