mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 18:43:41 -05:00
Exit gracefully if the transfer directory already exists
This commit is contained in:
parent
89dd9f9a6a
commit
6947f2c03c
1 changed files with 9 additions and 1 deletions
10
main.go
10
main.go
|
@ -61,7 +61,15 @@ func main() {
|
|||
}
|
||||
if *logInForTransfer {
|
||||
if currentDir, err := os.Getwd(); err == nil {
|
||||
os.Setenv("GOMUKS_ROOT", filepath.Join(currentDir, "transfer"))
|
||||
pack := filepath.Join(currentDir, "transfer")
|
||||
if _, err := os.Stat(pack); err == nil {
|
||||
fmt.Println("with the --log-in-for-transfer flag, gomuks packs your data up into")
|
||||
fmt.Println("the transfer/ directory so you can move it around easily. please make")
|
||||
fmt.Println("sure there is nothing there already, and then run it again.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
os.Setenv("GOMUKS_ROOT", pack)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue