update ui

This commit is contained in:
Zack Scholl 2018-06-24 19:33:27 -07:00
parent c5b7ba0905
commit 003aa64d2b
1 changed files with 3 additions and 3 deletions

View File

@ -220,12 +220,12 @@ func (c *Connection) Run() error {
if c.Code == "" { if c.Code == "" {
c.Code = GetRandomName() c.Code = GetRandomName()
} }
fmt.Fprintf(os.Stderr, "Code is '%s'\n", c.Code)
if c.File.IsDir { if c.File.IsDir {
fmt.Fprintf(os.Stderr, "Sending %s folder named '%s'\n", humanize.Bytes(uint64(c.File.Size)), c.File.Name[:len(c.File.Name)-4]) fmt.Fprintf(os.Stderr, "Sending %s folder named '%s'\n", humanize.Bytes(uint64(c.File.Size)), c.File.Name[:len(c.File.Name)-4])
} else { } else {
fmt.Fprintf(os.Stderr, "Sending %s file named '%s'\n", humanize.Bytes(uint64(c.File.Size)), c.File.Name) fmt.Fprintf(os.Stderr, "Sending %s file named '%s'\n", humanize.Bytes(uint64(c.File.Size)), c.File.Name)
} }
fmt.Fprintf(os.Stderr, "Code is: %s\n", c.Code)
log.Debug("starting relay in case local connections") log.Debug("starting relay in case local connections")
relay := NewRelay(&AppConfig{ relay := NewRelay(&AppConfig{
@ -391,7 +391,7 @@ func (c *Connection) runClient(serverName string) error {
publicKeyRecipient := receiveMessage(connection) publicKeyRecipient := receiveMessage(connection)
// check if okay again // check if okay again
if id == 0 { if id == 0 {
fmt.Fprintf(os.Stderr, "to %s\n", publicKeyRecipient) fmt.Fprintf(os.Stderr, "Send to public key: %s\n", publicKeyRecipient)
getOK := "y" getOK := "y"
if !c.Yes { if !c.Yes {
getOK = getInput("ok? (y/n): ") getOK = getInput("ok? (y/n): ")
@ -538,12 +538,12 @@ func (c *Connection) runClient(serverName string) error {
fType = "folder" fType = "folder"
fName = fName[:len(fName)-4] fName = fName[:len(fName)-4]
} }
fmt.Fprintf(os.Stderr, "Incoming file from "+publicKeySender+"\n")
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", 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", fType, fName, humanize.Bytes(uint64(c.File.Size)))
} }
fmt.Fprintf(os.Stderr, "from public key: "+publicKeySender+"\n")
var sentFileNames []string var sentFileNames []string
if c.AskPath { if c.AskPath {