Skip to content

Commit

Permalink
fix: resolve rsync command bug in wush rsync
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
coadler committed Aug 30, 2024
1 parent 9d98be1 commit 7a09a3f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/wush/rsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/coder/serpent"
"github.com/coder/wush/cliui"
"github.com/coder/wush/overlay"
"github.com/coder/wush/tsserver"
)

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

overlayOpts = new(sendOverlayOpts)
send = new(overlay.Send)
)
return &serpent.Command{
Use: "rsync [flags] -- [rsync args]",
Expand Down Expand Up @@ -61,9 +59,10 @@ func rsyncCmd() *serpent.Command {
args := []string{
"-c",
fmt.Sprintf(`rsync -e "%s ssh --auth-key %s --quiet --" %s`,
progPath, send.Auth.AuthKey(), strings.Join(inv.Args, " "),
progPath, overlayOpts.clientAuth.AuthKey(), strings.Join(inv.Args, " "),
),
}
fmt.Println(args)
fmt.Println("Running: rsync", strings.Join(inv.Args, " "))
cmd := exec.CommandContext(ctx, "sh", args...)
cmd.Stdin = inv.Stdin
Expand Down

0 comments on commit 7a09a3f

Please sign in to comment.