From 89b98eb986b6886f46ec5d5138140b71831ca22c Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Tue, 31 Jan 2012 00:28:13 +0800 Subject: [PATCH] Use $HOME in cron script, base_path no longer applicable --- lib/git/tools.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/git/tools.sh b/lib/git/tools.sh index 5f4bbe1..88c65e2 100644 --- a/lib/git/tools.sh +++ b/lib/git/tools.sh @@ -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")