Add batch import script

This commit is contained in:
thePR0M3TH3AN
2025-06-17 21:08:18 -04:00
parent 48c4bed936
commit fe1f778dba
5 changed files with 46 additions and 6 deletions

View File

@@ -15,10 +15,11 @@ done
CONFIG_PATH="src/config.json"
FROM_PDF=""
NON_INTERACTIVE=0
usage() {
echo "Usage: $0 [-c config_path] [--from-pdf PDF]"
echo "Create and deploy a flyer based on config.json."
echo "Usage: $0 [-c config_path] [--from-pdf PDF] [--no-interaction]"
echo "Create and deploy a flyer based on config.json."
exit 1
}
@@ -33,6 +34,10 @@ while [[ $# -gt 0 ]]; do
FROM_PDF="$2"
shift 2
;;
-n|--no-interaction)
NON_INTERACTIVE=1
shift
;;
-h|--help)
usage
;;
@@ -89,10 +94,12 @@ update_config_from_pdf() {
rm -rf "$tmpdir"
}
if [[ -n "$FROM_PDF" ]]; then
update_config_from_pdf
else
update_config_interactive
if [[ $NON_INTERACTIVE -eq 0 ]]; then
if [[ -n "$FROM_PDF" ]]; then
update_config_from_pdf
else
update_config_interactive
fi
fi
# Regenerate QR codes based on the updated configuration