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 2015-12-02 01:48:52 +09:00 committed by Anthony Fok
parent 6c8103144f
commit e989468341

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 + "/"