mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 01:21:28 +00:00
Do not try to find available port if set by user
He/she probably really meant it. Fixes #1901
This commit is contained in:
parent
ff4ca99286
commit
9349a889e2
1 changed files with 4 additions and 0 deletions
|
@ -118,6 +118,10 @@ func server(cmd *cobra.Command, args []string) error {
|
|||
if err == nil {
|
||||
l.Close()
|
||||
} else {
|
||||
if flagChanged(serverCmd.Flags(), "port") {
|
||||
// port set explicitly by user -- he/she probably meant it!
|
||||
return newSystemErrorF("Port %d already in use", serverPort)
|
||||
}
|
||||
jww.ERROR.Println("port", serverPort, "already in use, attempting to use an available port")
|
||||
sp, err := helpers.FindAvailablePort()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue