1
0
Fork 0
dotfiles/bin/cbwatch

22 lines
342 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
cmd="$@"
if [ -z "$cmd" ]; then
cmd=cat
fi
OSTYPE="$(uname -s)"
case "${OSTYPE}" in
Linux)
exec wl-paste --watch $cmd
;;
Darwin)
>&2 echo "TODO: Make this work on macOS"
;;
*)
>&2 echo "Unknown OS type: ${OSTYPE}"
exit 1
;;
esac