#!/usr/bin/env bash
# Prepare local dependencies and the default scheduler SQLite location.
set -euo pipefail

root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
scheduler_dir="${SCHEDULER_HOME:-"$HOME/ADHD_Scheduler"}"

cd "$root_dir"
dart pub get

mkdir -p "$scheduler_dir/backups"
if [[ ! -e "$scheduler_dir/scheduler.sqlite" ]]; then
  : > "$scheduler_dir/scheduler.sqlite"
fi

printf 'Scheduler SQLite path: %s\n' "$scheduler_dir/scheduler.sqlite"
