mirror of https://github.com/schollz/croc.git
improve recipient ui
This commit is contained in:
parent
13bf5994dc
commit
143f3dba14
10
connect.go
10
connect.go
|
@ -406,7 +406,7 @@ func (c *Connection) runClient(serverName string) error {
|
||||||
// check if okay again
|
// check if okay again
|
||||||
if id == 0 {
|
if id == 0 {
|
||||||
c.spinner.Stop()
|
c.spinner.Stop()
|
||||||
fmt.Fprintf(os.Stderr, "Your public key: %s\n", c.keypair.Public)
|
fmt.Fprintf(os.Stderr, "Your public keyYour public key: %s\n", c.keypair.Public)
|
||||||
fmt.Fprintf(os.Stderr, "Recipient public key: %s\n", publicKeyRecipient)
|
fmt.Fprintf(os.Stderr, "Recipient public key: %s\n", publicKeyRecipient)
|
||||||
getOK := "y"
|
getOK := "y"
|
||||||
if !c.Yes {
|
if !c.Yes {
|
||||||
|
@ -560,9 +560,9 @@ func (c *Connection) runClient(serverName string) error {
|
||||||
fName = fName[:len(fName)-4]
|
fName = fName[:len(fName)-4]
|
||||||
}
|
}
|
||||||
if _, err := os.Stat(path.Join(c.Path, c.File.Name)); os.IsNotExist(err) {
|
if _, err := os.Stat(path.Join(c.Path, c.File.Name)); os.IsNotExist(err) {
|
||||||
fmt.Fprintf(os.Stderr, "Receiving %s (%s) into: %s\n", fType, humanize.Bytes(uint64(c.File.Size)), fName)
|
fmt.Fprintf(os.Stderr, "Receiving %s (%s) into: '%s'\n\n", fType, humanize.Bytes(uint64(c.File.Size)), fName)
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(os.Stderr, "Overwriting %s %s (%s)\n", fType, fName, humanize.Bytes(uint64(c.File.Size)))
|
fmt.Fprintf(os.Stderr, "Overwriting %s '%s' (%s)\n\n", fType, fName, humanize.Bytes(uint64(c.File.Size)))
|
||||||
}
|
}
|
||||||
var sentFileNames []string
|
var sentFileNames []string
|
||||||
|
|
||||||
|
@ -752,13 +752,13 @@ func (c *Connection) runClient(serverName string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stderr, "\nReceived folder written to %s", path.Join(c.Path, c.File.Name[:len(c.File.Name)-4]))
|
fmt.Fprintf(os.Stderr, "\nReceived folder written to '%s'", path.Join(c.Path, c.File.Name[:len(c.File.Name)-4]))
|
||||||
} else {
|
} else {
|
||||||
outputStream := path.Join(c.Path, c.File.Name)
|
outputStream := path.Join(c.Path, c.File.Name)
|
||||||
if c.UseStdout {
|
if c.UseStdout {
|
||||||
outputStream = "stdout"
|
outputStream = "stdout"
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stderr, "\nReceived file written to %s", outputStream)
|
fmt.Fprintf(os.Stderr, "\nReceived file written to '%s'", outputStream)
|
||||||
if c.UseStdout {
|
if c.UseStdout {
|
||||||
defer os.Remove(path.Join(c.Path, c.File.Name))
|
defer os.Remove(path.Join(c.Path, c.File.Name))
|
||||||
b, _ := ioutil.ReadFile(path.Join(c.Path, c.File.Name))
|
b, _ := ioutil.ReadFile(path.Join(c.Path, c.File.Name))
|
||||||
|
|
Loading…
Reference in New Issue