Skip to content

Commit

Permalink
Fix generate-key in setup (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewScibek committed Jun 18, 2019
1 parent 43cf4ef commit 37f0e67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd
import (
"fmt"
"os"
"path/filepath"
"strings"
"syscall"

Expand Down Expand Up @@ -50,14 +51,15 @@ var setupCmd = &cobra.Command{
fmt.Print(color.GreenString("`punch generate-key`"), "\n\n")
return
}
err := generateKey("", "holepunch_key")
path := configPath + string(filepath.Separator)
err := generateKey(path, "holepunch_key")
if err != nil {
reportError("Could not generate key", true)
}
fmt.Print("Generated keys in the current directory ")
d := color.New(color.FgGreen, color.Bold)
d.Printf("✔\n")
err = writeKeysToConfig("", "holepunch_key")
err = writeKeysToConfig(path, "holepunch_key")
if err != nil {
reportError("Failed to update config file", true)
}
Expand Down

0 comments on commit 37f0e67

Please sign in to comment.