Files
cupsadmin/pkg/postinstall
kfattic eba94aae4e cupsadmin: CLI, CupsKit, app in progress
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 13:13:07 -05:00

18 lines
641 B
Bash
Executable File

#!/bin/bash
# cupsadmin postinstall (payload-free pkg): the binary ships in the Scripts archive next to this file.
# Never changes ownership/permissions of an existing /usr/local/bin (Homebrew on Intel owns it).
set -euo pipefail
TARGET="${3:-/}"
DEST_DIR="${TARGET%/}/usr/local/bin"
SOURCE="$(cd "$(dirname "$0")" && pwd)/cupsadmin"
if [ ! -d "$DEST_DIR" ]; then
mkdir -p -m 755 "$DEST_DIR"
echo "cupsadmin: created $DEST_DIR"
fi
# -S: copy to a temp file and rename, so a running cupsadmin is never half-written.
install -S -m 755 -o root -g wheel "$SOURCE" "$DEST_DIR/cupsadmin"
echo "cupsadmin: installed $DEST_DIR/cupsadmin"