Skip to content

put -r src/ /dest copies the folder's contents in place (#185) - #192

Merged
bdbarnett merged 1 commit into
mainfrom
put-r-trailing-slash
Oct 30, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
put-r-trailing-slash

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

A trailing slash on the folder you upload now means "its contents", as in rsync. mpftp put -r ./cast/ /cast copies the files into /cast (created if missing) and replaces changed files in place, so re-uploading a library no longer nests it as /cast/cast.

Without the slash nothing changes: put -r ./cast /cast still behaves like cp -r. get -r /cast/ ./cast reads the slash the same way, and so does cp between two boards.

Files on the board that the source folder lacks are left alone, as with rsync without --delete. The docs say so and point to mpftp rm.

Updated: put -r / get -r --help, the CLI reference, the file-transfer guide (where the nesting trap was explained) and the changelog.

Tested on an ESP32-P4 over serial: a first upload of 3 files, a re-upload that changed one file, added one and dropped one (the dropped one stayed on the board; the changed file hashed equal to the local copy), and the no-slash form still nested. Fixes #185.

@bdbarnett
bdbarnett force-pushed the put-r-trailing-slash branch from 92d1461 to afd06b4 Compare October 30, 2026 04:30
@bdbarnett
bdbarnett merged commit 1afc4ff into main Oct 30, 2026
8 checks passed
@bdbarnett
bdbarnett deleted the put-r-trailing-slash branch October 30, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

put -r nests the folder when the destination exists, so a re-upload leaves the old files in place

1 participant