shithub: hugo

Download patch

ref: 05300fde1d0ff8d8fe032b4300078ab79926a8de
parent: f037ae7b4fe08bccb547fe1821b10e86bfbc4f5d
author: Joel Scoble <[email protected]>
date: Wed Nov 5 15:13:22 EST 2014

add support for fsync's noTime flag

--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -52,7 +52,7 @@
 
 var hugoCmdV *cobra.Command
 
-var BuildWatch, Draft, Future, UglyUrls, Verbose, Logging, VerboseLog, DisableRSS, DisableSitemap, PluralizeListTitles bool
+var BuildWatch, Draft, Future, UglyUrls, Verbose, Logging, VerboseLog, DisableRSS, DisableSitemap, PluralizeListTitles, NoTimes bool
 var Source, Destination, Theme, BaseUrl, CfgFile, LogFile string
 
 func Execute() {
@@ -87,6 +87,7 @@
 	HugoCmd.PersistentFlags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program")
 	HugoCmd.PersistentFlags().BoolVar(&PluralizeListTitles, "pluralizeListTitles", true, "Pluralize titles in lists using inflect")
 	HugoCmd.Flags().BoolVarP(&BuildWatch, "watch", "w", false, "watch filesystem for changes and recreate as needed")
+	HugoCmd.Flags().BoolVarP(&NoTimes, "noTimes", "", false, "Don't sync modification time of files")
 	hugoCmdV = HugoCmd
 }
 
@@ -225,6 +226,7 @@
 	publishDir := helpers.AbsPathify(viper.GetString("PublishDir")) + "/"
 
 	syncer := fsync.NewSyncer()
+	syncer.NoTimes = viper.GetBool("notimes")
 	syncer.SrcFs = hugofs.SourceFs
 	syncer.DestFs = hugofs.DestinationFS