Make noTimes command flag work

Hugo command provides "noTimes" flag but it doesn't affect synced files
timestamp regardless of whether the flag is specified or not.

This fixes it by adding a flag check and overwriting configuration if it
is specified.

Fix #1583
This commit is contained in:
Tatsushi Demachi authored and Anthony Fok committed 2015-12-01 10:01:44 -07:00
1 parent 6c8103144f
commit e989468341
1 file changed
+5
+5
View File
@@ -244,6 +244,11 @@ func InitializeConfig() {
if hugoCmdV.PersistentFlags().Lookup("logFile").Changed {
viper.Set("LogFile", LogFile)
}
if hugoCmdV.Flags().Lookup("noTimes").Changed {
viper.Set("noTimes", NoTimes)
}
if BaseURL != "" {
if !strings.HasSuffix(BaseURL, "/") {
BaseURL = BaseURL + "/"