Major Changes: - NEW: Scripts 09 & 10 for KPI calculation and enhanced reporting - NEW: Shell script wrappers (01-10) for easier execution - NEW: R packages flextable and officer for enhanced Word reports - NEW: DEPLOYMENT_README.md with complete deployment guide - RENAMED: Numbered R scripts (02, 03, 04) for clarity - REMOVED: Old package management scripts (using renv only) - UPDATED: Workflow now uses scripts 09->10 instead of 05 Files Changed: 90+ files New Packages: flextable, officer New Scripts: 09_run_calculate_kpis.sh, 10_run_kpi_report.sh Documentation: DEPLOYMENT_README.md, EMAIL_TO_ADMIN.txt See DEPLOYMENT_README.md for full deployment instructions.
32 lines
846 B
Bash
32 lines
846 B
Bash
#!/bin/bash
|
|
# Run crop messaging analysis (06_crop_messaging)
|
|
# Usage: ./06_run_crop_messaging.sh --current_week=<week_num> --previous_week=<week_num> --estate_name=<name>
|
|
|
|
current_week=$(date +%V) # Current ISO week number
|
|
previous_week=$((current_week - 1))
|
|
estate_name="aura"
|
|
|
|
for arg in "$@"; do
|
|
case $arg in
|
|
--current_week=*)
|
|
current_week="${arg#*=}"
|
|
;;
|
|
--previous_week=*)
|
|
previous_week="${arg#*=}"
|
|
;;
|
|
--estate_name=*)
|
|
estate_name="${arg#*=}"
|
|
;;
|
|
*)
|
|
echo "Unknown option: $arg"
|
|
exit 1
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
echo "Running crop messaging analysis for $estate_name: week $previous_week → week $current_week."
|
|
cd r_app
|
|
Rscript 06_crop_messaging $current_week $previous_week $estate_name
|
|
cd ..
|