Skip to content

feat(pull,push): match ares-cli path rules - #13

Merged
mariotaku merged 1 commit into
mainfrom
feat/ares-cli-path-compat
Aug 16, 2026
Merged

feat(pull,push): match ares-cli path rules#13
mariotaku merged 1 commit into
mainfrom
feat/ares-cli-path-compat

Conversation

@mariotaku

Copy link
Copy Markdown
Member

ares-push and ares-pull used a trailing / on DESTINATION to decide the
layout. @webosose/ares-cli ignores the trailing slash and reads the layout
from what DESTINATION already is. This aligns both.

Path rules

SOURCE DESTINATION Result
a directory missing, or a directory DEST/<name>
a directory a file error
a lone file a directory DEST/<name>
a lone file missing, or a file DEST
many files anything but a file DEST/<name> each

So ares-push build /media/developer/apps now lands at
/media/developer/apps/build, as in ares-cli. Before it copied the contents
into /media/developer/apps.

Flags

-i, --ignore now means "Hide the detailed copy messages", which is what
ares-cli documents. Continue-on-error moves to a new -k, --keep-going.

Breaking: scripts using -i to keep going need -k.

Other compat fixes

  • push makes missing parents of DESTINATION, like mkdir -p, with a cache so
    it does not re-stat per file.
  • push copies a symlink to a file as its content, as ares-cli does.
  • pull follows symlinks, the way find -follow does in ares-cli.
  • pull probes SOURCE with stat, so a missing source reports
    "does not exist on the device".

Extensions past ares-cli gaps

  • pull to a path whose parent is missing works. ares-cli throws ENOENT from
    lstatSync.
  • pull skips a broken symlink with a message, and stops at 64 levels of
    nesting instead of looping.
  • push skips a symlink to a directory with a message instead of failing.
  • Everything runs over SFTP, so the device needs no find or mkdir.

Not changed

Output stays src => dst. ares-cli prints Push:src -> dst plus a
N file(s) pushed summary, but no other tool in this repo copies ares-cli
output.

Test

cargo test -p ares-pull -p ares-push — 14 tests, covering the path table
above and the device-path parent walk.

🤖 Generated with Claude Code

ares-cli picks the layout from what DESTINATION already is, not from a
trailing "/". A directory keeps its own name under DESTINATION, and a lone
file keeps its name only when DESTINATION is a directory. Push now also
errors when several SOURCEs go onto a file, and makes missing parents.

-i/--ignore now means "hide the detailed copy messages", as in ares-cli.
Continue-on-error moves to the new -k/--keep-going.

Extensions past ares-cli gaps: pull to a path with a missing parent works,
pull skips a broken symlink and stops at 64 levels of nesting, and push
skips a symlink to a directory instead of failing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mariotaku
mariotaku marked this pull request as ready for review August 16, 2026 08:45
@mariotaku
mariotaku merged commit 86deddb into main Aug 16, 2026
4 checks passed
@mariotaku
mariotaku deleted the feat/ares-cli-path-compat branch September 1, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant