mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
commands: Remove accidental and breaking space in baseURL flag
And added key-trimming to prevent future mishaps. See #4607
This commit is contained in:
@@ -189,7 +189,7 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) {
|
||||
"templateMetricsHints",
|
||||
|
||||
// Moved from vars.
|
||||
"baseURL ",
|
||||
"baseURL",
|
||||
"buildWatch",
|
||||
"cacheDir",
|
||||
"cfgFile",
|
||||
@@ -231,6 +231,7 @@ var deprecatedFlags = map[string]bool{
|
||||
}
|
||||
|
||||
func setValueFromFlag(flags *flag.FlagSet, key string, cfg config.Provider, targetKey string) {
|
||||
key = strings.TrimSpace(key)
|
||||
if flags.Changed(key) {
|
||||
if _, deprecated := deprecatedFlags[strings.ToLower(key)]; deprecated {
|
||||
msg := fmt.Sprintf(`Set "%s = true" in your config.toml.
|
||||
|
Reference in New Issue
Block a user