Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ammario committed Aug 22, 2024
1 parent e7eac12 commit 5f82c19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set up a relay server.

## Basic Usage

Install:
```
go install github.com/coder/wush/cmd/wush@latest
```
6 changes: 2 additions & 4 deletions cmd/wush/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ func logF(format string, args ...any) {
}

func receiveCmd() *serpent.Command {
var (
overlayType string
)
var overlayType string
return &serpent.Command{
Use: "receive",
Handler: func(inv *serpent.Invocation) error {
Expand Down Expand Up @@ -62,7 +60,7 @@ func receiveCmd() *serpent.Command {

fmt.Println("Your auth key is:")
fmt.Println("\t>", cliui.Code(r.ClientAuth().AuthKey()))
fmt.Println("Use this key to authenticate other", cliui.Code("wush"), "commands to authenticate to this instance.")
fmt.Println("Use this key to authenticate other", cliui.Code("wush"), "commands to this instance.")

s, err := tsserver.NewServer(ctx, logger, r)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion cmd/wush/rsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"log/slog"
"net/netip"
"os"
"os/exec"
"strings"

Expand Down Expand Up @@ -76,9 +77,10 @@ func rsyncCmd() *serpent.Command {
fmt.Println("\t> Server overlay public key: ", cliui.Code(send.Auth.ReceiverPublicKey.ShortString()))
fmt.Println("\t> Server overlay auth key: ", cliui.Code(send.Auth.OverlayPrivateKey.Public().ShortString()))

progPath := os.Args[0]
args := []string{
"-c",
"rsync --progress --stats -avz --human-readable " + fmt.Sprintf("-e=\"wush --auth-id %s --stdio --\" ", send.Auth.AuthKey()) + strings.Join(inv.Args, " "),
"rsync --progress --stats -avz --human-readable " + fmt.Sprintf("-e=\"%s --auth-id %s --stdio --\" ", progPath, send.Auth.AuthKey()) + strings.Join(inv.Args, " "),
}
fmt.Println("Running: rsync", args)
cmd := exec.CommandContext(ctx, "sh", args...)
Expand Down
3 changes: 1 addition & 2 deletions cmd/wush/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ func sshCmd() *serpent.Command {
Handler: func(inv *serpent.Invocation) error {
ctx := inv.Context()
logger := slog.New(slog.NewTextHandler(io.Discard, nil))

if authID == "" {
err := huh.NewInput().
Title("Enter your Auth ID:").
Title("Enter the receiver's Auth ID:").
Value(&authID).
Run()
if err != nil {
Expand Down

0 comments on commit 5f82c19

Please sign in to comment.