Add update-cron task
This commit is contained in:
parent
614a383662
commit
b57c77b400
1 changed files with 14 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue