github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/builder/src/extract-domain.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "io/ioutil" 6 "os" 7 8 "github.com/deis/deis/builder" 9 ) 10 11 func main() { 12 if fi, _ := os.Stdin.Stat(); fi.Mode()&os.ModeNamedPipe == 0 { 13 fmt.Println("this app only works using the stdout of another process") 14 os.Exit(1) 15 } 16 17 bytes, err := ioutil.ReadAll(os.Stdin) 18 if err != nil { 19 fmt.Println(err) 20 os.Exit(1) 21 } 22 23 domain, err := builder.ParseDomain(bytes) 24 25 if err != nil { 26 fmt.Println(err) 27 os.Exit(1) 28 } 29 30 fmt.Println(domain) 31 }