Compare commits

..

5 Commits

3 changed files with 32 additions and 19 deletions

View File

@ -4,14 +4,16 @@ This script depends on `bc`.
### Help ### Help
``` ```
Usage: ./pizza.sh [ -f <N> ] [ -R <recipe> ] [ <flour weight>g|<pan diameter>(in|inch|") ] Usage: ./pizza.sh [ -f <N> ] [ -R <recipe> ] [ <pan diameter>(in|inch|") ]
./pizza.sh [ -h ] ./pizza.sh [ -f <N> ] [ -R <recipe> ] [ <flour weight>g ]
./pizza.sh [ -r ] ./pizza.sh -h
./pizza.sh -r [ -v <variation> ]
Options: Options:
-h Print this help -h Print this help
-r Print the recipe -r Print the recipe
-f <N> Set flour per square inch -f <N> Set flour per square inch (default: 2.122)
-R <recipe> Set recipe -v <variation> Set variation (default: standmixer)
-R <recipe> Set recipe (default: quick)
Notes: Notes:
The dough can be kept overnight in the refidgerator if needed The dough can be kept overnight in the refidgerator if needed
Water may also be used in place of beer Water may also be used in place of beer

View File

@ -1,20 +1,22 @@
#!/usr/bin/env bash #!/usr/bin/env bash
PWD="$(dirname "$(readlink -f "$0")")" # find the pizza working directory PWD="$(dirname "$(readlink -f "$0")")" # find the pizza working directory
RECIPE=${RECIPE:-quick} RECIPE="${RECIPE:-quick}"
VARIATION=${VARIATION:-standmixer} VARIATION="${VARIATION:-standmixer}"
shopt -s extglob shopt -s extglob
function pizzahelp { # this only prints help text function pizzahelp { # this only prints help text
echo "Pizza Calculator: The pizza script you never asked for" echo "Pizza Calculator: The pizza script you never asked for"
echo echo
echo "Usage: $0 [ -f <N> ] [ -R <recipe> ] [ <flour weight>g|<pan diameter>(in|inch|\") ]" echo "Usage: $0 [ -f <N> ] [ -R <recipe> ] [ <pan diameter>(in|inch|\") ]"
echo " $0 [ -h ]" echo " $0 [ -f <N> ] [ -R <recipe> ] [ <flour weight>g ]"
echo " $0 [ -r ]" echo " $0 -h"
echo " $0 -r [ -v <variation> ]"
echo "Options:" echo "Options:"
echo " -h Print this help" echo " -h Print this help"
echo " -r Print the recipe" echo " -r Print the recipe"
echo " -f <N> Set flour per square inch" echo " -f <N> Set flour per square inch (default: 2.122)"
echo " -R <recipe> Set recipe" echo " -v <variation> Set variation (default: standmixer)"
echo " -R <recipe> Set recipe (default: quick)"
echo "Notes:" echo "Notes:"
echo " The dough can be kept overnight in the refidgerator if needed" echo " The dough can be kept overnight in the refidgerator if needed"
echo " Water may also be used in place of beer" echo " Water may also be used in place of beer"
@ -28,7 +30,7 @@ function pizzarecipe {
sed -n "/\[$RECIPE:instructions:$VARIATION\]/,/^$/p" "$PWD/pizza.txt" | sed '/\[*.\]/d' sed -n "/\[$RECIPE:instructions:$VARIATION\]/,/^$/p" "$PWD/pizza.txt" | sed '/\[*.\]/d'
} }
while getopts ":hrR:f:" option; do # loop through options, casing them while getopts ":hrv:R:f:" option; do # loop through options, casing them
case $option in case $option in
h) h)
pizzahelp pizzahelp
@ -37,11 +39,11 @@ while getopts ":hrR:f:" option; do # loop through options, casing them
pizzarecipe pizzarecipe
exit;; exit;;
f) # the end result of changing this is to alter crust thickness f) # the end result of changing this is to alter crust thickness
FSI=$OPTARG;; FSI="$OPTARG";;
v) # change variation (usually between hand and standmixer) v) # change variation (usually between hand and standmixer)
VARIATION=$OPTARG;; VARIATION="$OPTARG";;
R) # change dough recipe R) # change dough recipe
RECIPE=$OPTARG;; RECIPE="$OPTARG";;
\?) \?)
echo "Error: Invalid option" echo "Error: Invalid option"
exit;; exit;;
@ -50,9 +52,9 @@ done
shift $((OPTIND-1)) # shift options out from infront of the command to leave only arugment in $@ shift $((OPTIND-1)) # shift options out from infront of the command to leave only arugment in $@
function panarea { function panarea {
FSI=${FSI:-2.12206590789} # default grams of Flour per Square Inch of pan, fairly neopolitan FSI="${FSI:-2.12206590789}" # default grams of Flour per Square Inch of pan, fairly neopolitan
AREA=$(echo "3.1415926535*($DIAM/2)^2" | bc -l) # bc cant exponentiate non-integer bases without -l AREA=$(echo "3.1415926535*($DIAM/2)^2" | bc -l) # bc cant exponentiate non-integer bases without -l
SIZE=$(echo $AREA*$FSI | bc) SIZE=$(echo $AREA*"$FSI" | bc)
arraytio arraytio
} }

View File

@ -41,4 +41,13 @@ sugar 0.049
yeast 0.0018 yeast 0.0018
oil 0.0625 oil 0.0625
# 2.12206590789g of flour/square inch [long:instructions:standmixer]
1: combine oil, water, sugar, and salt in mixing bowl
2: add flour and yeast
3: mix for 10 minutes
4: transfer to oversize bowl for rising
5: rise for 3 days in refrigerator
6: turn onto, then shape to pan
7: rise for 10 minutes
8: add sauce, toppings
9: bake at 550f until done