Skip to content

Commit

Permalink
Merge pull request #145 from nathanegillett/9158
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Gillett authored Dec 8, 2021
2 parents 844d018 + 9b89283 commit 8bf9b14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/cmd_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ func TestMainSyncFilesFrom(t *testing.T) {
"rsync",
"-vvv",
"--files-from", filesFromPath,
srcPath + "/",
srcPath,
"exodus:/dest",
}

Expand Down
6 changes: 6 additions & 0 deletions internal/cmd/exodus.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func exodusMain(ctx context.Context, cfg conf.Config, args args.Config) int {
if args.FilesFrom != "" {
args.Relative = true

// When using --files-from, we don't want to recreate the source directory.
// Ensure the source path ends with a slash (/), indicating we only want it's contents.
if !strings.HasSuffix(args.Src, "/") {
args.Src += "/"
}

f, err := os.Open(args.FilesFrom)
if err != nil {
logger.F("src", args.Src, "error", err).Error("can't read --files-from file")
Expand Down

0 comments on commit 8bf9b14

Please sign in to comment.