Minor improvements to UI

This commit is contained in:
Zack Scholl 2017-10-22 11:26:53 -06:00
parent 3d14420ff8
commit dbb5ddf2b6
2 changed files with 9 additions and 4 deletions

View File

@ -317,10 +317,16 @@ func (c *Connection) runClient() error {
log.Debugf("meta data received: %v", c.File)
// have the main thread ask for the okay
if id == 0 {
fType := "file"
fName := path.Join(c.Path, c.File.Name)
if c.File.IsDir {
fType = "folder"
fName = fName[:len(fName)-4]
}
if _, err := os.Stat(path.Join(c.Path, c.File.Name)); os.IsNotExist(err) {
fmt.Printf("Receiving file (%s) into: %s\n", humanize.Bytes(uint64(c.File.Size)), path.Join(c.Path, c.File.Name))
fmt.Printf("Receiving %s (%s) into: %s\n", fType, humanize.Bytes(uint64(c.File.Size)), fName)
} else {
fmt.Printf("Overwriting file %s (%s)\n", path.Join(c.Path, c.File.Name), humanize.Bytes(uint64(c.File.Size)))
fmt.Printf("Overwriting %s %s (%s)\n", fType, fName, humanize.Bytes(uint64(c.File.Size)))
}
var sentFileNames []string

View File

@ -38,8 +38,7 @@ func main() {
/^^\________/0 \ ||
( ` + "`" + `~+++,,_||__,,++~^^^^^^^
...V^V^V^V^V^V^\...............................
`)
flags := new(Flags)
flag.BoolVar(&flags.Relay, "relay", false, "run as relay")