mirror of https://github.com/schollz/croc.git
Minor improvements to UI
This commit is contained in:
parent
3d14420ff8
commit
dbb5ddf2b6
10
connect.go
10
connect.go
|
@ -317,10 +317,16 @@ func (c *Connection) runClient() error {
|
||||||
log.Debugf("meta data received: %v", c.File)
|
log.Debugf("meta data received: %v", c.File)
|
||||||
// have the main thread ask for the okay
|
// have the main thread ask for the okay
|
||||||
if id == 0 {
|
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) {
|
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 {
|
} 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
|
var sentFileNames []string
|
||||||
|
|
||||||
|
|
1
main.go
1
main.go
|
@ -39,7 +39,6 @@ func main() {
|
||||||
( ` + "`" + `~+++,,_||__,,++~^^^^^^^
|
( ` + "`" + `~+++,,_||__,,++~^^^^^^^
|
||||||
...V^V^V^V^V^V^\...............................
|
...V^V^V^V^V^V^\...............................
|
||||||
|
|
||||||
|
|
||||||
`)
|
`)
|
||||||
flags := new(Flags)
|
flags := new(Flags)
|
||||||
flag.BoolVar(&flags.Relay, "relay", false, "run as relay")
|
flag.BoolVar(&flags.Relay, "relay", false, "run as relay")
|
||||||
|
|
Loading…
Reference in New Issue