Skip to content

Commit 724a915

Browse files
authored
Merge pull request #16157 from nileshtrivedi/master
cmd/puppeth: Don't allow hyphen in network name. Fixes #16155
2 parents 45ce4dc + 085d3fb commit 724a915

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎cmd/puppeth/wizard_intro.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@ func (w *wizard) run() {
5959
fmt.Println()
6060

6161
// Make sure we have a good network name to work with fmt.Println()
62+
// Docker accepts hyphens in image names, but doesn't like it for container names
6263
if w.network == "" {
63-
fmt.Println("Please specify a network name to administer (no spaces, please)")
64+
fmt.Println("Please specify a network name to administer (no spaces or hyphens, please)")
6465
for {
6566
w.network = w.readString()
66-
if !strings.Contains(w.network, " ") {
67+
if !strings.Contains(w.network, " ") && !strings.Contains(w.network, "-") {
6768
fmt.Printf("\nSweet, you can set this via --network=%s next time!\n\n", w.network)
6869
break
6970
}
70-
log.Error("I also like to live dangerously, still no spaces")
71+
log.Error("I also like to live dangerously, still no spaces or hyphens")
7172
}
7273
}
7374
log.Info("Administering Ethereum network", "name", w.network)

0 commit comments

Comments
 (0)