🌱 Capture flag args in bash
#!/bin/bash
#set -o nounset
#set -o errexit
INPUT='./urls.txt'
DEVICE='mobile'
while getopts 'i:d:' flag; do
case "${flag}" in
i) INPUT=${OPTARG} ;;
d) DEVICE=${OPTARG} ;;
esac
done
lighthouse-batch -f $INPUT -h -o ./reports/`date '+%Y-%m-%d_%H.%M.%S'`-$DEVICE -p '--emulated-form-factor="$DEVICE"'