Rewrite rcopy as a safe Go CLI#2
Draft
mrAibo wants to merge 13 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
0/1exit-status contractrcopy.shas a compatibility shim for existing shell setupsrcopy-linux-amd64Why
The previous script only defined functions when executed, changed caller-shell traps and file descriptors when sourced, built several remote shell commands from strings, passed the wrong lowercase port flag to
scp, and could delete excluded files after an rsync move. The Go CLI constructs process arguments explicitly and uses safer transfer semantics.User and developer impact
--remove-source-files; remote sync removes source files only after both copy stages succeedscp -Phandlingsource rcopy.shworkflow through the compatibility shimNO_COLORsupportValidation performed locally
gofmtgo mod verifygo test ./...go test -race ./...go vet ./...GOPROXY=off GOSUMDB=off go build -mod=vendorCGO_ENABLED=0 GOOS=linux GOARCH=amd64build, verified as statically linkedBats itself was not installed in the local environment; GitHub Actions runs the committed Bats suite.