diff --git a/README.md b/README.md index f4f89d0..0925a68 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,11 @@ Set to `0` by default. Set this to an extra message you want to send when the upload is done. A good option may be a tag list or a link to changelog. Set to nothing to disable. Disabled by default. +##### HANDLE_DONE_MSG +Set this to an extra message you want to send when file handling is done. +A good option may be a tag list or a link to changelog. +Will only fire where no other messages are sent. +Set to nothing to disable. Disabled by default. ##### FAILURE_MSG Set this to an extra message you want to send if the build fails. Set to nothing to disable. Disabled by default. diff --git a/build.conf b/build.conf index b178465..26f72d6 100644 --- a/build.conf +++ b/build.conf @@ -67,6 +67,8 @@ AUTO_REBOOT = 0 AUTO_SLOT = 0 # An extra message to send when uploading is done (blank to disable) UPLOAD_DONE_MSG = +# An extra message to send when all handlings are done (blank to disable) +HANDLE_DONE_MSG = # An extra message to send when the build fails (blank to disable) FAILURE_MSG = # twrp decryption key / pattern diff --git a/makeBuild.sh b/makeBuild.sh index 25e3809..4415da8 100755 --- a/makeBuild.sh +++ b/makeBuild.sh @@ -67,7 +67,7 @@ adb_wait() done } -# waits until device is unlocked unlocked +# waits until device is unlocked # $1: (optional) delay between scans in seconds (defaults to 1) # $2: (optional) path to check (defaults to /sdcard/) adb_wait_unlocked() @@ -370,6 +370,7 @@ rewrite_config() config_write "AUTO_REBOOT" "${AUTO_REBOOT}" $confPath config_write "AUTO_SLOT" "${AUTO_REBOOT}" $confPath config_write "UPLOAD_DONE_MSG" "${UPLOAD_DONE_MSG}" $confPath + config_write "HANDLE_DONE_MSG" "${HANDLE_DONE_MSG}" $confPath config_write "FAILURE_MSG" "${FAILURE_MSG}" $confPath config_write "TWRP_PIN" "${TWRP_PIN}" $confPath config_write "TWRP_SIDELOAD" "${TWRP_SIDELOAD}" $confPath @@ -525,6 +526,8 @@ init_conf() fi echo -en "${YELLOW}Set extra upload message [${BLUE}blank${YELLOW}]: ${NC}" read UPLOAD_DONE_MSG + echo -en "${YELLOW}Set extra handling done message [${BLUE}blank${YELLOW}]: ${NC}" + read HANDLE_DONE_MSG echo -en "${YELLOW}Set extra failure message [${BLUE}blank${YELLOW}]: ${NC}" read FAILURE_MSG echo -en "${YELLOW}Set TWRP decryption pin " @@ -654,6 +657,9 @@ print_confs() if [[ $UPLOAD_DONE_MSG != '' ]]; then echo -e "Upload done message :${BLUE} ${UPLOAD_DONE_MSG}${NC}" fi + if [[ $HANDLE_DONE_MSG != '' ]]; then + echo -e "Handling done message :${BLUE} ${HANDLE_DONE_MSG}${NC}" + fi if [[ $FAILURE_MSG != '' ]]; then echo -e "Failure message :${BLUE} ${FAILURE_MSG}${NC}" fi @@ -1396,6 +1402,10 @@ if [[ $buildRes == 0 ]]; then # if build succeeded trap - SIGINT fi + if [[ $HANDLE_DONE_MSG != '' ]] && [[ $isSilent == 0 ]] && [[ $isUpload != 1 ]]; then + ./telegramSend.sh --cite --tmp "${tmpDir}" --config "${TG_SEND_CFG_FILE}" "${HANDLE_DONE_MSG}" + fi + # Should only reach here if not handled yet if [[ $UNHANDLED_PATH != '' ]] && [[ $isKeep != 1 ]]; then mv $PATH_TO_BUILD_FILE "${UNHANDLED_PATH}"/