Add update-cron task

This commit is contained in:
Starbeamrainbowlabs 2019-08-09 23:45:32 +01:00
parent 614a383662
commit b57c77b400
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 14 additions and 2 deletions

View File

@ -44,8 +44,9 @@ if [[ "$#" -lt 1 ]]; then
echo -e " ./build ${CTOKEN}{action}${RS} ${CTOKEN}{action}${RS} ${CTOKEN}{action}${RS} ...";
echo -e "";
echo -e "${CSECTION}Available actions${RS}";
echo -e " ${CACTION}setup${RS} - Perform initial setup";
echo -e " ${CACTION}update${RS} - Scan for new packages and add them to the repository";
echo -e " ${CACTION}setup${RS} - Perform initial setup";
echo -e " ${CACTION}update${RS} - Scan for new packages and add them to the repository";
echo -e " ${CACTION}update-cron${RS} - Like ${CACTION}update${RS}, but silent unless something goes wrong";
echo -e "";
exit 1;
@ -152,6 +153,17 @@ task_update() {
task_end $?;
}
task_update-cron() {
tmpfile="$(mktmp --suffix ".aptosaurus.log")";
set +e;
bash "./aptosaurus.sh update" | ansi_strip >"${tmpfile}";
exit_code="${0}";
if [[ "${exit_code}" -ne 0 ]]; then
cat "${tmpfile}";
fi
}
###############################################################################