forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate
More file actions
executable file
·103 lines (77 loc) · 2.56 KB
/
update
File metadata and controls
executable file
·103 lines (77 loc) · 2.56 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
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
#!/bin/bash
pushd "$HOME/dotfiles" > /dev/null || exit 1;
CURRENT_HASH=`md5sum update | awk '{ print $1 }'`
echo -n "Pulling changes... "
git pull
git submodule init
git submodule sync
git submodule update
NEW_HASH=`md5sum update | awk '{ print $1 }'`
if [ "$CURRENT_HASH" != "$NEW_HASH" ]
then
echo "The update script has changed."
./update
exit
fi
echo "Syncing..."
./sync
#!/bin/sh
echo "Setting up your Mac..."
# Check for Homebrew and install if we don't have it
if test ! $(which brew); then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update Homebrew recipes
brew update
# Install all our dependencies with bundle (See Brewfile)
brew tap homebrew/bundle
brew bundle
# Make ~ZSH~ bash the default shell environment
chsh -s $(which bash)
# Install PHP extensions with PECL
pecl install imagick
source "$HOME/.bashrc"
if [ ! -f bin/composer ]
then
echo "Installing composer..."
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin --filename=composer
fi
# Install global Composer packages
/usr/local/bin/composer global require laravel/installer laravel/spark-installer laravel/valet
# Install Laravel Valet
$HOME/.composer/vendor/bin/valet install
if [ ! -f includes/bash_docker-compose.bash ]
then
echo "Installing docker-compose autocomplete..."
curl -L https://raw.githubusercontent.com/docker/compose/1.21.2/contrib/completion/bash/docker-compose -o includes/bash_docker-compose.bash
fi
if [ ! -f bin/php-cs-fixer ]
then
echo "Installing php-cs-fixer..."
curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.9.0/php-cs-fixer.phar -o bin/php-cs-fixer
chmod +x bin/php-cs-fixer
fi
# Install global NPM packages
npm install --global yarn
# Create a Sites directory
# This is a default directory for macOS user accounts but doesn't comes pre-installed
mkdir $HOME/Sites
# 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
# Symlink the Mackup config file to the home directory
ln -s $HOME/.dotfiles/.mackup.cfg $HOME/.mackup.cfg
# Set macOS preferences
# We will run this last because this will reload the shell
source .macos
echo -n "Updating composer and dependencies... "
bin/composer --quiet self-update
echo "Done."
if [ ! -L resources/git-template/hooks ]
then
ln -s $HOME/dotfiles/resources/git-hooks resources/git-template/hooks
fi
popd > /dev/null
echo "Run the following command to reload your prompt"
echo
echo "source ~/.bashrc"