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
```
Usage: ./pizza.sh [ -f <N> ] [ -R <recipe> ] [ <flour weight>g|<pan diameter>(in|inch|") ]
./pizza.sh [ -h ]
./pizza.sh [ -r ]
Usage: ./pizza.sh [ -f <N> ] [ -R <recipe> ] [ <pan diameter>(in|inch|") ]
./pizza.sh [ -f <N> ] [ -R <recipe> ] [ <flour weight>g ]
./pizza.sh -h
./pizza.sh -r [ -v <variation> ]
Options:
-h Print this help
-r Print the recipe
-f <N> Set flour per square inch
-R <recipe> Set recipe
-f <N> Set flour per square inch (default: 2.122)
-v <variation> Set variation (default: standmixer)
-R <recipe> Set recipe (default: quick)
Notes:
The dough can be kept overnight in the refidgerator if needed
Water may also be used in place of beer

View File

@ -1,20 +1,22 @@
#!/usr/bin/env bash
PWD="$(dirname "$(readlink -f "$0")")" # find the pizza working directory
RECIPE=${RECIPE:-quick}
VARIATION=${VARIATION:-standmixer}
RECIPE="${RECIPE:-quick}"
VARIATION="${VARIATION:-standmixer}"
shopt -s extglob
function pizzahelp { # this only prints help text
echo "Pizza Calculator: The pizza script you never asked for"
echo
echo "Usage: $0 [ -f <N> ] [ -R <recipe> ] [ <flour weight>g|<pan diameter>(in|inch|\") ]"
echo " $0 [ -h ]"
echo " $0 [ -r ]"
echo "Usage: $0 [ -f <N> ] [ -R <recipe> ] [ <pan diameter>(in|inch|\") ]"
echo " $0 [ -f <N> ] [ -R <recipe> ] [ <flour weight>g ]"
echo " $0 -h"
echo " $0 -r [ -v <variation> ]"
echo "Options:"
echo " -h Print this help"
echo " -r Print the recipe"
echo " -f <N> Set flour per square inch"
echo " -R <recipe> Set recipe"
echo " -f <N> Set flour per square inch (default: 2.122)"
echo " -v <variation> Set variation (default: standmixer)"
echo " -R <recipe> Set recipe (default: quick)"
echo "Notes:"
echo " The dough can be kept overnight in the refidgerator if needed"
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'
}
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
h)
pizzahelp
@ -37,11 +39,11 @@ while getopts ":hrR:f:" option; do # loop through options, casing them
pizzarecipe
exit;;
f) # the end result of changing this is to alter crust thickness
FSI=$OPTARG;;
FSI="$OPTARG";;
v) # change variation (usually between hand and standmixer)
VARIATION=$OPTARG;;
VARIATION="$OPTARG";;
R) # change dough recipe
RECIPE=$OPTARG;;
RECIPE="$OPTARG";;
\?)
echo "Error: Invalid option"
exit;;
@ -50,9 +52,9 @@ done
shift $((OPTIND-1)) # shift options out from infront of the command to leave only arugment in $@
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
SIZE=$(echo $AREA*$FSI | bc)
SIZE=$(echo $AREA*"$FSI" | bc)
arraytio
}

View File

@ -41,4 +41,13 @@ sugar 0.049
yeast 0.0018
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