mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Add pipes between builds; remove 'time'
This commit is contained in:
@ -19,6 +19,8 @@ JQ=/opt/homebrew/bin/jq
|
|||||||
curl -s -H "Circle-Token: ${CIRCLE_TOKEN}" "https://circleci.com/api/v1.1/recent-builds?limit=10&shallow=true" > $FILE
|
curl -s -H "Circle-Token: ${CIRCLE_TOKEN}" "https://circleci.com/api/v1.1/recent-builds?limit=10&shallow=true" > $FILE
|
||||||
NOW=$(date +%s)
|
NOW=$(date +%s)
|
||||||
|
|
||||||
|
needPipe=0
|
||||||
|
|
||||||
checkBuild()
|
checkBuild()
|
||||||
{
|
{
|
||||||
index=$1
|
index=$1
|
||||||
@ -86,9 +88,26 @@ checkBuild()
|
|||||||
color="gray"
|
color="gray"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
####################################################################################################
|
||||||
|
## if this is the 1st build, or it was less than some-short-time ago, then put it in the menu bar ##
|
||||||
|
####################################################################################################
|
||||||
if [ $index -lt 1 -o $seconds -lt 600 ]; then
|
if [ $index -lt 1 -o $seconds -lt 600 ]; then
|
||||||
echo -n "${shortRepo}(${shortAge})${icon} "
|
|
||||||
|
###########################################################################################
|
||||||
|
## put a pipe (unicode special pipe, to not break things) before all but the first build ##
|
||||||
|
###########################################################################################
|
||||||
|
if [ "$needPipe" == "1" ]; then
|
||||||
|
echo -n " | "
|
||||||
|
fi
|
||||||
|
needPipe=1
|
||||||
|
|
||||||
|
echo -n "${shortRepo}(${shortAge})${icon}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
## always append the build to the dropdown ($details) ##
|
||||||
|
########################################################
|
||||||
details="$details\n$repo/${branch}${tag}: $jobName: $buildStatus @ $age ago | color=$color | href=$url | image=$avatarB64"
|
details="$details\n$repo/${branch}${tag}: $jobName: $buildStatus @ $age ago | color=$color | href=$url | image=$avatarB64"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +118,9 @@ for i in $(seq 0 9); do
|
|||||||
checkBuild $i
|
checkBuild $i
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "@$(date +%M:%S)"
|
## echo "@$(date +%M:%S)"
|
||||||
|
echo
|
||||||
|
|
||||||
echo -e "$details"
|
echo -e "$details"
|
||||||
|
|
||||||
cp $FILE /tmp/cci-latest.json
|
cp $FILE /tmp/cci-latest.json
|
||||||
|
Reference in New Issue
Block a user