From 0053be979a8b9f8b0887d4e2aeb24485a4cdcf3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dato=20Sim=C3=B3?= Date: Fri, 9 May 2014 02:23:26 +0100 Subject: [PATCH] Correctly print server URL when base-url is specified in the command line When running hugo server like: $ hugo server -s docs -b myhostname the printed output now directs to http://myhostname:1313 instead of (invariably) http://localhost:1313. As per server(), BaseUrl is never empty, and the required value is always found in Viper. --- commands/server.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commands/server.go b/commands/server.go index d4089bdb3..ed04f0410 100644 --- a/commands/server.go +++ b/commands/server.go @@ -79,11 +79,7 @@ func server(cmd *cobra.Command, args []string) { func serve(port int) { jww.FEEDBACK.Println("Serving pages from " + helpers.AbsPathify(viper.GetString("PublishDir"))) - if BaseUrl == "" { - jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl")) - } else { - jww.FEEDBACK.Printf("Web Server is available at http://localhost:%v\n", port) - } + jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl")) fmt.Println("Press ctrl+c to stop")