1
0
mirror of https://github.com/byReqz/go-etcher.git synced 2024-11-22 15:01:16 +00:00

add recursion to getpath and getdest

This commit is contained in:
Nils 2022-01-13 23:32:55 +01:00
parent 79e7417126
commit 37348c71aa
Signed by: byreqz
GPG Key ID: 396A62D7D436749E

View File

@ -37,6 +37,10 @@ func GetPath() string {
} }
return homedir + path[1:] return homedir + path[1:]
} }
if path == "" {
fmt.Println("[", color.RedString("!"), "] No image given, retrying.")
path = GetPath()
}
return path return path
} }
@ -53,6 +57,10 @@ func GetDest() string {
} }
return homedir + dest[1:] return homedir + dest[1:]
} }
if dest == "" {
fmt.Println("[", color.RedString("!"), "] No destination given, retrying.")
dest = GetDest()
}
return dest return dest
} }