-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaptop.local
136 lines (122 loc) · 3.16 KB
/
laptop.local
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Configuration
ZSHRC="$HOME/.zshrc"
# Function Definitions
fancy_echo() {
printf "\\n%s\\n" "$1"
}
install_homebrew_packages() {
fancy_echo "Installing Homebrew and MAS packages ..."
brew bundle --file=- <<EOF
brew "bat"
brew "chromedriver"
brew "eza"
brew "mas"
brew "postgresql@14"
brew "postgresql@17"
brew "shellcheck"
brew "spaceship"
brew "sqlite"
brew "the_silver_searcher"
brew "zoxide"
cask "1password"
cask "airbuddy"
cask "backblaze"
cask "cursor"
cask "docker"
cask "downie"
cask "firefox"
cask "firefox@developer-edition"
cask "google-chrome"
cask "imageoptim"
cask "kaleidoscope"
cask "local"
cask "ngrok"
cask "obsidian"
cask "permute"
cask "postman"
cask "raycast"
cask "readdle-spark"
cask "replacicon"
cask "slack"
cask "sublime-text"
cask "tableplus"
cask "transmit"
cask "the-unarchiver"
cask "transnomino"
cask "utm"
cask "warp"
cask "zoom"
cask "font-fira-code-nerd-font"
cask "font-fira-mono-nerd-font"
mas "Endel", id: 1346247457
mas "Fantastical", id: 975937182
mas "Kindle", id: 302584613
mas "Harvest", id: 506189836
mas "Things", id: 904280696
mas "xScope 4", id: 889428659
EOF
brew cleanup
}
install_python() {
fancy_echo "Configuring asdf for Python ..."
if [ ! -d "$HOME/.asdf" ]; then
brew install asdf
append_to_zshrc "source \"$(brew --prefix asdf)/libexec/asdf.sh\""
. "$ZSHRC"
else
fancy_echo "ASDF is already installed."
fi
# Install Python plugin for asdf
if ! asdf plugin-list | grep -Fq "python"; then
asdf plugin-add python
fi
# Install the latest stable Python version
local latest_python
latest_python=$(asdf list-all python | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | tail -1)
if ! asdf list python | grep -Fq "$latest_python"; then
fancy_echo "Installing Python $latest_python ..."
asdf install python "$latest_python"
asdf global python "$latest_python"
fancy_echo "Python $latest_python installed and set as global version."
else
fancy_echo "Latest Python $latest_python is already installed."
fi
}
install_php() {
fancy_echo "Configuring asdf for PHP ..."
if [ ! -d "$HOME/.asdf" ]; then
brew install asdf
append_to_zshrc "source \"$(brew --prefix asdf)/libexec/asdf.sh\""
. "$ZSHRC"
else
fancy_echo "ASDF is already installed."
fi
# Install PHP plugin for asdf
if ! asdf plugin-list | grep -Fq "php"; then
asdf plugin-add php
fi
# Install the latest stable PHP version
local latest_php
latest_php=$(asdf list-all php | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | tail -1)
if ! asdf list php | grep -Fq "$latest_php"; then
fancy_echo "Installing PHP $latest_php ..."
asdf install php "$latest_php"
asdf global php "$latest_php"
fancy_echo "PHP $latest_php installed and set as global version."
else
fancy_echo "Latest PHP $latest_php is already installed."
fi
}
# Main Execution
fancy_echo "Starting setup..."
# Install Homebrew and MAS packages
install_homebrew_packages
# Install and configure latest stable version of Python
install_python
# Install and configure latest stable version of PHP
install_php
# Source .zshrc
fancy_echo "Sourcing $ZSHRC..."
. "$ZSHRC"
# All done!
fancy_echo "All done! Your development environment is ready."