#!/bin/bash
# ============================================================
# croc.sh — croc peer-to-peer file transfer tool
# ============================================================
# Installs croc, a simple command-line tool for sending files
# and folders between two computers using end-to-end encryption
# and a relay server.  Unlike scp, croc works through NAT and
# firewalls without needing port forwarding, making it ideal
# for ad-hoc transfers on the local network or the internet.
#
# Usage: croc send <file>      (sender)
#        croc <code-phrase>    (receiver)
#
# croc is available in the official Arch repos.
# This is an optional module because it is only needed when
# transferring files to/from machines that don't share a
# common filesystem or SSH access.
# ============================================================

set -euo pipefail
# Load shared logging helpers from the dotfiles lib
source "$(dirname "${BASH_SOURCE[0]}")/../../lib/logging.sh"

# ── croc (official repos) ─────────────────────────────────────────────────────
log "Installing croc (file transfer)..."
sudo pacman -S --noconfirm --needed croc

log "croc installed."
