generated from me/template-mit
42 lines
783 B
Bash
Executable File
42 lines
783 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# 20260730 - Hyperling
|
|
# Generate .ics files for a shared Moonthly calendar hosted on cloud.hyperling.com.
|
|
|
|
export DEBUG=true
|
|
|
|
echo "`date` - Running $0"
|
|
|
|
## Parameters
|
|
|
|
# start date
|
|
# end date
|
|
# number of moonths
|
|
# year
|
|
|
|
## Install Pre-Reqs ##
|
|
|
|
npm="`which npm`"
|
|
if [[ ! -s "$npm" ]]; then
|
|
echo "ERROR: npm does not seem to be available. Please ensure it is installed"
|
|
echo "Aborting."
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "\n`date` - Dependencies | Installing..."
|
|
$npm install
|
|
echo -e "\n`date` - Dependencies | Done!\n"
|
|
|
|
## Main ##
|
|
|
|
# TBD: Remove hardcoded test dates.
|
|
start_date="2026-07-30"
|
|
end_date="2026-08-10"
|
|
|
|
echo -e "\n`date` - Main | Running...\n"
|
|
./moonth-generator.js "$start_date" "$end_date" "$DEBUG"
|
|
echo -e "\n`date` - Main | Done!\n"
|
|
|
|
## Finish ##
|
|
|
|
exit 0
|