#!/usr/bin/env bash set -Eeuo pipefail REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P) BOOTSTRAP="$REPO_ROOT/scripts/bootstrap-recurring-scrape.sh" TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/dce-bootstrap-smoke.XXXXXX") cleanup() { rm -rf "$TMP_DIR" } trap cleanup EXIT [[ -x "$BOOTSTRAP" ]] || { printf 'bootstrap-recurring-scrape.sh is not executable\n' >&2 exit 1 } "$BOOTSTRAP" --help | grep -q 'bootstrap-recurring-scrape' || { printf 'bootstrap --help missing expected text\n' >&2 exit 1 } mkdir -p "$TMP_DIR/archive/demo" printf '{"messages":[{"id":"1","timestamp":"2020-01-01T00:00:00+00:00"}],"channel":{"id":"111111111111111111"}}\n' \ >"$TMP_DIR/archive/demo/Guild - general [111111111111111111].json" cat >"$TMP_DIR/config.json" <&2 exit 1 } printf 'bootstrap-recurring-scrape-smoke: ok\n'