Use new update script for dotfiles
This script will also install composer, set up the git hooks and install some global dependencies. Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
This commit is contained in:
parent
ebddd9bb7f
commit
116fcc44c4
BIN
bin/composer
BIN
bin/composer
Binary file not shown.
@ -41,7 +41,7 @@ alias myip="ifconfig | grep 'inet ' | grep -v 127.0.0.1 | awk '{print \$2}'"
|
|||||||
alias update="source "$HOME/dotfiles/setup/update.sh""
|
alias update="source "$HOME/dotfiles/setup/update.sh""
|
||||||
|
|
||||||
# Update dotfiles
|
# Update dotfiles
|
||||||
alias dotfiles="pushd "$HOME/dotfiles" > /dev/null 2>&1; git pull && ./sync.py && . "$HOME/.bashrc"; popd > /dev/null 2>&1; nyan"
|
alias dotfiles="$HOME/dotfiles/update.sh"
|
||||||
|
|
||||||
# Clean up LaunchServices to remove duplicates in the “Open With” menu
|
# Clean up LaunchServices to remove duplicates in the “Open With” menu
|
||||||
#alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
|
#alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
|
||||||
|
44
update.sh
Executable file
44
update.sh
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
pushd "$HOME/dotfiles" > /dev/null || exit 1;
|
||||||
|
|
||||||
|
CURRENT_HASH=`md5sum update.sh | awk '{ print $1 }'`
|
||||||
|
|
||||||
|
echo -n "Pulling changes... "
|
||||||
|
git pull
|
||||||
|
|
||||||
|
NEW_HASH=`md5sum update.sh | awk '{ print $1 }'`
|
||||||
|
if [ "$CURRENT_HASH" != "$NEW_HASH" ]
|
||||||
|
then
|
||||||
|
echo "The update script has changed."
|
||||||
|
./update
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Syncing..."
|
||||||
|
./sync.py
|
||||||
|
|
||||||
|
source "$HOME/.bashrc"
|
||||||
|
|
||||||
|
if [ ! -f bin/composer ]
|
||||||
|
then
|
||||||
|
echo "Installing composer..."
|
||||||
|
wget https://getcomposer.org/composer.phar -O bin/composer
|
||||||
|
chmod +x bin/composer
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "Updating composer and dependencies... "
|
||||||
|
bin/composer --quiet self-update
|
||||||
|
bin/composer --quiet global require \
|
||||||
|
fabpot/php-cs-fixer \
|
||||||
|
phpmd/phpmd \
|
||||||
|
phpunit/phpunit \
|
||||||
|
squizlabs/php_codesniffer
|
||||||
|
|
||||||
|
echo "Done."
|
||||||
|
|
||||||
|
if [ ! -L resources/git-template/hooks ]
|
||||||
|
then
|
||||||
|
ln -s $HOME/dotfiles/resources/git-hooks resources/git-template/hooks
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd > /dev/null
|
Loading…
Reference in New Issue
Block a user