Have the software-install.sh script do 'the lot' and call once per day from .bashrc.

This commit is contained in:
Scott Wallace 2016-03-07 21:23:56 +00:00
parent 483fd526c8
commit 3063819931
2 changed files with 18 additions and 12 deletions

13
.bashrc
View file

@ -133,18 +133,9 @@ fi
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Update brew if it's older than one day
# Update software if it's been longer than one day
#--------------------------------------------------------------------------------
if [ -x /usr/local/bin/brew ]; then
export HOMEBREW_GITHUB_API_TOKEN=$(getkey HOMEBREW_GITHUB_API_TOKEN)
(
find /usr/local/.git -name FETCH_HEAD -mtime +0 -exec \
bash -c "echo \"--Start: $(date)\"; \
brew update; \
echo \"--End: $(date)\"" \
\; >> ~/var/log/brew-update.log 2>&1 &
)
fi
( find ~/var/log -name update.log -mtime +0 -exec ~/bin/software-install.sh \; >> ~/var/log/update.log 2>&1 & )
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------

View file

@ -38,6 +38,12 @@ function install_osx_software {
fi
#-------------------------------
#-------------------------------
# Update Brew formulae if older than 24 hours
#-------------------------------
find /usr/local/.git -name FETCH_HEAD -mtime +0 -exec brew update \;
#-------------------------------
#-------------------------------
# Install the basics
#-------------------------------
@ -98,6 +104,10 @@ function install_osx_software {
#-------------------------------
}
echo "#-------------------------------"
echo "# START: $(date)"
echo "#-------------------------------"
#-------------------------------
# Check for Mac OS X
#-------------------------------
@ -111,7 +121,12 @@ fi
#-------------------------------
# Ensure Vim plugins are up-to-date
#-------------------------------
vim +PluginInstall +PluginUpdate +qall
vim -T dumb +PluginInstall! +PluginClean! +qall 2>/dev/null |\
sed -E s/'\[[0-9]{1,2};[0-9]{1,2}[mKH]'//g
#-------------------------------
echo "#-------------------------------"
echo "# END: $(date)"
echo "#-------------------------------"
exit 0