| | |
| | | |
| | | # now that we have a list of updated receipts, we are going to process them |
| | | for r in ${updatedreceipts}; do |
| | | printf "\n\nNew receipt found: %s\n" "${receiptname[${r}]}" |
| | | # get the name for the UID and fetch only that object |
| | | receipt=$(eval curl -XGET ${CURLOPTS} '${APIURL}/apis/de.eenfach.olbohlen/v1/namespaces/${NAMESPACE}/cookiereceipts/${receiptname[${r}]}' ) |
| | | |
| | |
| | | |
| | | preheat_b=$( echo "${receipt}" | jq -r .spec.preheat ) |
| | | if [ "x${preheat_b}" == "xtrue" ]; then |
| | | printf "Pre: we heat up the oven to %s degrees %s\n" "${temperature}" "${scale:-Celsius}" |
| | | printf "Pre: we heat up the oven to %s degrees %s\n\n" "${temperature}" "${scale:-Celsius}" |
| | | fi |
| | | |
| | | # how many ingredients do we have? |
| | | num_in=$(echo "${receipt}" | jq .spec.ingredients\[\].name | wc -l) |
| | | |
| | | |
| | | # list up that we fetch needed ingredients |
| | | printf "Fetching ingredients from receipt:\n" |
| | | i=0 |
| | | while [ ${i} -lt ${num_in} ]; do |
| | | in_name=$( echo "${receipt}" | jq -r .spec.ingredients[${i}].name ) |
| | |
| | | num_steps=$(echo "${receipt}" | jq .spec.steps\[\].order | wc -l) |
| | | |
| | | # now let's iterate over that |
| | | printf "Processing the instructions:\n" |
| | | i=1 |
| | | while [ ${i} -lt ${num_steps} ]; do |
| | | instruction=$( echo "${receipt}" | jq '.spec.steps[] | select(.order == '${i}') | { instruction | join (" ")' ) |
| | |
| | | sleep 1 |
| | | i=$(( ${i} + 1 )) |
| | | done |
| | | printf "Done with this receipt.\n\n" |
| | | done |
| | | done |
| | | |