Skip to content

Commit 7a09a3f

Browse files
committed
fix: resolve rsync command bug in wush rsync
Fixed a bug that caused the `wush rsync` command to malfunction due to residual references to an outdated variable. Removed unnecessary import and adjusted the command construction to use the correct `overlayOpts` structure. Added a temporary print statement for debugging.
1 parent 9d98be1 commit 7a09a3f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cmd/wush/rsync.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
"github.com/coder/serpent"
1313
"github.com/coder/wush/cliui"
14-
"github.com/coder/wush/overlay"
1514
"github.com/coder/wush/tsserver"
1615
)
1716

@@ -22,7 +21,6 @@ func rsyncCmd() *serpent.Command {
2221
logf = func(str string, args ...any) {}
2322

2423
overlayOpts = new(sendOverlayOpts)
25-
send = new(overlay.Send)
2624
)
2725
return &serpent.Command{
2826
Use: "rsync [flags] -- [rsync args]",
@@ -61,9 +59,10 @@ func rsyncCmd() *serpent.Command {
6159
args := []string{
6260
"-c",
6361
fmt.Sprintf(`rsync -e "%s ssh --auth-key %s --quiet --" %s`,
64-
progPath, send.Auth.AuthKey(), strings.Join(inv.Args, " "),
62+
progPath, overlayOpts.clientAuth.AuthKey(), strings.Join(inv.Args, " "),
6563
),
6664
}
65+
fmt.Println(args)
6766
fmt.Println("Running: rsync", strings.Join(inv.Args, " "))
6867
cmd := exec.CommandContext(ctx, "sh", args...)
6968
cmd.Stdin = inv.Stdin

0 commit comments

Comments
 (0)