#!/usr/bin/env bash set -euo pipefail # Sets secure file permissions on ~/.context/config.json. # Run after every `context auth add` to protect stored credentials. # Safe to run when the file does not exist yet. CONFIG="${HOME}/.context/config.json" if [ ! -f "$CONFIG" ]; then echo "Skipped: ${CONFIG} does not exist — no permissions to set." exit 0 fi chmod 600 "$CONFIG" echo "Secured: ${CONFIG} set to 600 (owner read/write only)."