#!/usr/bin/env bash # Has this repo opted in to build and deploy? # # Prints "true" or "false". cd.yml's guard job reads it; build and deploy run # only when it says true (#3). Opt in by committing a regular file named # .deploy-enabled -- after the infra manifest (k3s/apps/spatial-agent-app) exists, not before. # # The marker must be a regular file and NOT a symlink. `[ -f ]` follows # symlinks, so it alone would say true for a link to any regular file. # # A missing directory exits 2 with nothing on stdout. Answering "false" there # would make a typo in the workflow look like a deliberate opt-out. set -euo pipefail dir="${1:-.}" if [ ! -d "$dir" ]; then echo "deploy-enabled: no such directory: $dir" >&2 exit 2 fi marker="$dir/.deploy-enabled" if [ -f "$marker" ] && [ ! -L "$marker" ]; then echo "true" else echo "false" fi