Commit 0ca5c1d7 authored by David Revoy's avatar David Revoy

Prompt at the end of script in a user-friendly way

An attempt at having less to do with this script and get more option
to reboot it instead of closing and relaunching a new instance each
time.
parent a8c46914
......@@ -139,7 +139,7 @@ elif [ "$menuchoicecleaned" = "‣ Community update" ]; then
function_run_in_terminal "$project_root/$folder_tools/update-community.sh"
elif [ "$menuchoicecleaned" = "‣ Render all" ]; then
function_run_in_terminal "$project_root/$folder_tools/update-all.sh"
function_run_in_terminal "$project_root/$folder_tools/update-all.sh --prompt"
elif [ "$menuchoicecleaned" = "+ Add a new episode" ]; then
function_run_in_terminal "$project_root/$folder_tools/add-a-new-episode.sh"
......
......@@ -266,15 +266,26 @@ cat "$project_root"/"$folder_webcomics"/last_updated.txt
# Footer library
function_load_source_lib "$script_absolute_path"/lib/footer.sh
# Auto upload changes
"$project_root"/"$folder_tools"/uploader.sh
printf "\033]0;%s\007\n" "Renderfarm (done)"
if [ "$1" = "--prompt" ]; then
# Task is executed inside a terminal window (pop-up)
# This line prevent terminal windows to be auto-closed
# and necessary to read log later, or to reload the script
echo "${Purple} Press [Enter] to exit or ${White}${BlueBG}[r]${Off} to reload or ${White}${BlueBG}[u]${Off} to upload all the change. ${Off}"
echo "${Purple} Press [Enter] to launch renderfarm again or:"
echo "${White}${BlueBG}[q]${Off} => to Quit. ${Off}"
echo "${White}${BlueBG}[u]${Off} => to launch an Upload only. ${Off}"
read -p "?" ANSWER
if [ "$ANSWER" = "r" ]; then
"$project_root"/"$folder_tools"/"$script_filename" --prompt
if [ "$ANSWER" = "q" ]; then
exit
elif [ "$ANSWER" = "u" ]; then
"$project_root"/"$folder_tools"/uploader.sh --prompt
# Launch a new upload without prompting at the end
"$project_root"/"$folder_tools"/uploader.sh
else
# Launch this very script again
"$project_root"/"$folder_tools"/"$script_filename" --prompt
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment