| | |
| | | |
| | | # list up that we fetch needed ingredients |
| | | printf "Fetching ingredients from receipt:\n" |
| | | printf "----------------------------------\n" |
| | | i=0 |
| | | while [ ${i} -lt ${num_in} ]; do |
| | | in_name=$( echo "${receipt}" | jq -r .spec.ingredients[${i}].name ) |
| | |
| | | if [ "x${in_remarks}" != "xnull" ]; then |
| | | printf " (%s)" "${in_remarks}" |
| | | fi |
| | | printf "\n" |
| | | printf "\n\n" |
| | | sleep 1 |
| | | i=$(( ${i} + 1 )) |
| | | done |
| | |
| | | |
| | | # now let's iterate over that |
| | | printf "\n\nProcessing the instructions:\n" |
| | | printf "----------------------------\n" |
| | | i=1 |
| | | while [ ${i} -lt ${num_steps} ]; do |
| | | while [ ${i} -le ${num_steps} ]; do |
| | | instruction=$( echo "${receipt}" | jq '.spec.steps[] | select(.order == '${i}') | { instruction } | join (" ")' ) |
| | | |
| | | printf "Step %i/%i: %s..." ${i} ${num_steps} "${instruction}" |
| | | sleep $(( ${RANDOM} % 6 + 1 )) |
| | | printf "done\n" |
| | | printf "done\n\n" |
| | | sleep 1 |
| | | i=$(( ${i} + 1 )) |
| | | done |