-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fresh.sh
143 lines (109 loc) · 3.75 KB
/
fresh.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
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
137
138
139
140
141
142
#!/bin/sh
#Inspirations
#https://github.com/mikeprivette/yanmss/blob/master/setup.sh
#https://github.com/driesvints/dotfiles
echo "Setting up your Mac..."
# Install command-line tools using Homebrew.
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
if [ ! -f $HOME/.ssh/id_rsa ]; then
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
fi
# Check for Homebrew and install if we don't have it
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Installing xcode-stuff"
xcode-select --install
# Install XCode Command Line Tools
echo 'Checking to see if XCode Command Line Tools are installed...'
brew config
# Updating Homebrew.
echo "Updating Homebrew..."
brew update
# Upgrade any already-installed formulae.
echo "Upgrading Homebrew..."
brew upgrade
# Install all our dependencies with bundle (See Brewfile)
brew tap homebrew/bundle
brew bundle
# Remove outdated versions from the cellar.
echo "Running brew cleanup..."
brew cleanup
echo "You're done!"
# Start mysql
brew services start mysql
# Set default MySQL root password and auth type.
mysql -u root -e "ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''; FLUSH PRIVILEGES;"
# Install PHP extensions with PECL
printf "\n" | pecl install memcached imagick redis
# Install global Composer packages
/usr/local/bin/composer global require laravel/valet beyondcode/expose laravel-zero/installer tightenco/lambo tightenco/takeout friendsofphp/php-cs-fixer phpmd/phpmd squizlabs/php_codesniffer sebastian/phpcpd phpdocumentor/phpdocumentor phploc/phploc
#remove
expose token 7d235ef9-70ca-413a-816a-8a9914d70f6a
# Global Node packages
./node.sh
# Install Laravel Valet
$HOME/.composer/vendor/bin/valet install
# Create a Sites directory
# This is a default directory for macOS user accounts but doesn't comes pre-installed
if [ -d $HOME/Code ]
then
# Create sites subdirectories
if [ ! -d $HOME/Code/Codeasea ]
then
mkdir $HOME/Code/Codeasea
fi
if [ ! -d $HOME/Code/Aecor ]
then
mkdir $HOME/Code/Aecor
fi
if [ ! -d $HOME/Code/Zero ]
then
mkdir $HOME/Code/Zero
fi
if [ ! -d $HOME/Code/Personal ]
then
mkdir $HOME/Code/Personal
fi
if [ ! -d $HOME/Code/Experiments ]
then
mkdir $HOME/Code/Experiments
fi
else
mkdir $HOME/Code
mkdir $HOME/Code/Codeasea
mkdir $HOME/Code/Aecor
mkdir $HOME/Code/Zero
mkdir $HOME/Code/Personal
mkdir $HOME/Code/Experiments
fi
# Clone Github repositories
./clone.sh
# Update the Terminal
# Install oh-my-zsh
echo "Installing oh-my-zsh..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --keep-zshrc
# Removes .zshrc from $HOME (if it exists) and symlinks the .zshrc file from the .dotfiles
rm -rf $HOME/.zshrc
ln -s $HOME/.dotfiles/.zshrc $HOME/.zshrc
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $HOME/.oh-my-zsh/themes/powerlevel10k
rm -rf $HOME/.p10k.zsh
ln -s $HOME/.dotfiles/.p10k.zsh $HOME/.p10k.zsh
# Symlink the Mackup config file to the home directory
ln -s $HOME/.dotfiles/.mackup.cfg $HOME/.mackup.cfg
# Global gitignore
ln -s $HOME/.dotfiles/.gitignore_global $HOME/.gitignore_global
git config --global core.excludesfile $HOME/.gitignore_global
# Set macOS preferences
# We will run this last because this will reload the shell
#temporary
source .macos
echo "Need to logout now to start the new SHELL..."
exit