Unverified Commit 724a9154 authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #16157 from nileshtrivedi/master

cmd/puppeth: Don't allow hyphen in network name. Fixes #16155
parents 45ce4dce 085d3fbf
...@@ -59,15 +59,16 @@ func (w *wizard) run() { ...@@ -59,15 +59,16 @@ func (w *wizard) run() {
fmt.Println() fmt.Println()
// Make sure we have a good network name to work with fmt.Println() // Make sure we have a good network name to work with fmt.Println()
// Docker accepts hyphens in image names, but doesn't like it for container names
if w.network == "" { if w.network == "" {
fmt.Println("Please specify a network name to administer (no spaces, please)") fmt.Println("Please specify a network name to administer (no spaces or hyphens, please)")
for { for {
w.network = w.readString() w.network = w.readString()
if !strings.Contains(w.network, " ") { if !strings.Contains(w.network, " ") && !strings.Contains(w.network, "-") {
fmt.Printf("\nSweet, you can set this via --network=%s next time!\n\n", w.network) fmt.Printf("\nSweet, you can set this via --network=%s next time!\n\n", w.network)
break break
} }
log.Error("I also like to live dangerously, still no spaces") log.Error("I also like to live dangerously, still no spaces or hyphens")
} }
} }
log.Info("Administering Ethereum network", "name", w.network) log.Info("Administering Ethereum network", "name", w.network)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment