tmux-party/deploy.sh
veg 6be0ac1877 Initial pre-release
tmux-party: share a tmux session with people on the same UNIX host.
Single-file POSIX shell (party) with a filesystem + tmux server-access
trust model. See README.md.
2026-06-01 15:31:54 +00:00

49 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
# Sync the deployable surface to a remote host for `make install`. Pins the
# include list to the seven items the project ships: Makefile, party, party.1,
# README.md, tools/post-install.sh, and tests/ (so the host can run `make
# check` as a target-OS smoke test). This is the dev-rsync variant. The
# release-tarball variant strips tests/ as well; not implemented here.
#
# Usage:
# ./deploy.sh <host>[:path] [extra rsync args]
#
# Path defaults to `tmux-party-src` (relative to the remote login user's
# home directory) when omitted.
#
# Examples:
# ./deploy.sh user@domain.tld # → :tmux-party-src
# ./deploy.sh user@domain.tld:dev/tmux-party-src # explicit path
# ./deploy.sh user@domain.tld -n # dry-run, default path
set -eu
dest="${1:-}"
[ -n "$dest" ] || {
echo "usage: $0 <host>[:path] [extra rsync args]" >&2
exit 2
}
shift
# Default path when only a host (no ":path") is given. Bare-host form
# is the common case for casual sync; an explicit path overrides it.
case "$dest" in
*:*) ;;
*) dest="$dest:tmux-party-src" ;;
esac
cd "$(dirname "$0")"
exec rsync -av --delete "$@" \
--include='/Makefile' \
--include='/party' \
--include='/party.1' \
--include='/README.md' \
--include='/tools/' \
--include='/tools/post-install.sh' \
--include='/tests/' \
--include='/tests/*.bats' \
--include='/tests/helpers.bash' \
--include='/tests/run-remote.sh' \
--exclude='*' \
./ "$dest"