Use $HOME in cron script, base_path no longer applicable

This commit is contained in:
Nathan Broadbent
2012-01-31 00:28:13 +08:00
parent ada316bd5b
commit 89b98eb986

View File

@@ -122,11 +122,10 @@ fi
# Creates and excludes .travis_status~
# Use with SCM breeze repo index.
# Add the following line to your crontab: (updates every 2 minutes)
# */2 * * * * /bin/bash -c '. /home/YOUR_USERNAME/.bashrc && git_index --rebuild && NOCD=true git_index --batch-cmd git_update_travis_status'
# */2 * * * * /bin/bash -c '. $HOME/.bashrc && git_index --rebuild && git_index --batch-cmd git_update_travis_status'
#
git_update_travis_status() {
if [ -z "$base_path" ]; then local base_path=$(pwd); fi
if [ -e "$base_path/.travis.yml" ]; then
if [ -e ".travis.yml" ]; then
if type ruby > /dev/null 2>&1 && type travis > /dev/null 2>&1; then
# Only use slug from origin
local repo=$(ruby -e "puts %x[cd $base_path && git remote -v].scan(/origin.*(?:\:|\/)([^\:\/]+\/[^\:\/]+)\.git/m).flatten.uniq")