Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/omarchy-tailscale-receive
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ claim_path() {
announce() {
local path="$1"
local name="${path##*/}"
local args=("Received $name" "Saved to ${dir/#$HOME/~}" -u critical)
local args=("Received $name" "Saved to ${dir/#"$HOME"/"~"}" -u critical)

case "${name,,}" in
*.png | *.jpg | *.jpeg | *.gif | *.webp | *.avif | *.bmp | *.tif | *.tiff)
Expand Down
14 changes: 14 additions & 0 deletions test/shell.d/tailscale-receive-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@ pass "taildrop receive ignores downloads that arrive while it waits"
[[ -z $(ls -A "$downloads/.omarchy-taildrop") ]] ||
fail "taildrop receive empties its staging directory" "$(ls -A "$downloads/.omarchy-taildrop")"
pass "taildrop receive empties its staging directory"

# A downloads directory under home is shown the way people know it, as ~/...
# The home path carries glob characters so it must be matched as a literal prefix.
home="$WORKDIR/home[1]"
mkdir -p "$home/Downloads"
printf 'pdf' >"$WORKDIR/outbox/report.pdf"
: >"$WORKDIR/notifications"
HOME="$home" PATH="$WORKDIR/bin:$PATH" "$ROOT/bin/omarchy-tailscale-receive" --once "$home/Downloads"

notifications=$(<"$WORKDIR/notifications")

grep -qF -- "Received report.pdf Saved to ~/Downloads -u critical" <<<"$notifications" ||
fail "taildrop receive shortens a downloads directory under home to ~" "$notifications"
pass "taildrop receive shortens a downloads directory under home to ~"