-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathupdate
More file actions
executable file
·56 lines (45 loc) · 1.34 KB
/
update
File metadata and controls
executable file
·56 lines (45 loc) · 1.34 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
#!/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
source "$HOME/.bashrc"
if [ ! -f bin/composer ]
then
echo "Installing composer..."
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin --filename=composer
fi
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.13.0/php-cs-fixer.phar -o bin/php-cs-fixer
chmod +x bin/php-cs-fixer
fi
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"