-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-tools.sh
More file actions
executable file
·74 lines (62 loc) · 2.38 KB
/
install-tools.sh
File metadata and controls
executable file
·74 lines (62 loc) · 2.38 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Check if Homebrew (brew) is installed
if ! command -v brew &> /dev/null; then
# Prompt the user to install Homebrew (defaults to "yes")
read -p "Homebrew (brew) is not installed. Do you want to install it now? (Y/n): " brew_choice
brew_choice=${brew_choice:-Y}
if [[ "$brew_choice" == "y" || "$brew_choice" == "Y" ]]; then
# Install Homebrew using the official installation script
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Confirm the installation
if ! command -v brew &> /dev/null; then
echo "Error: Homebrew installation failed."
exit 1
fi
else
echo "Homebrew is required. Please install it manually."
exit 1
fi
else
echo "Homebrew is already installed."
fi
# Check if the GitHub CLI is installed
if ! command -v gh &> /dev/null; then
# Prompt the user to install GitHub CLI (defaults to "yes")
read -p "GitHub CLI (gh) is required but not installed. Do you want to install it now? (Y/n): " gh_choice
gh_choice=${gh_choice:-Y}
if [[ "$gh_choice" == "y" || "$gh_choice" == "Y" ]]; then
# Install GitHub CLI using Homebrew
brew install gh
# Confirm the installation
if ! command -v gh &> /dev/null; then
echo "Error: GitHub CLI installation failed."
exit 1
fi
else
echo "GitHub CLI is required. Please install it manually."
exit 1
fi
else
echo "GitHub CLI is already installed."
fi
# Check if the keychain secrets manager (ks) is installed
if ! command -v ks &> /dev/null; then
# Prompt the user to install ks (defaults to "yes")
read -p "Keychain secrets manager is required but not installed. Do you want to install it now? (Y/n): " ks_choice
ks_choice=${ks_choice:-Y}
if [[ "$ks_choice" == "y" || "$ks_choice" == "Y" ]]; then
# Install keychain secrets manager using Homebrew
brew tap loteoo/formulas
brew install ks
# Confirm the installation
if ! command -v ks &> /dev/null; then
echo "Error: Keychain secrets manager installation failed."
exit 1
fi
else
echo "Keychain secrets manager is required. Please install it manually."
exit 1
fi
else
echo "Keychain secrets manager is already installed."
fi