commit e989468341d32be9404e86469b3563e1567df738
parent 6c8103144fc7b65251d2ba26eb23630bc96807f0
Author: Tatsushi Demachi <tdemachi@gmail.com>
Date: Wed, 2 Dec 2015 01:48:52 +0900
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
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -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 + "/"