src/jsdoc/DocBuilder.vala wip_alan_T5666_roojspacker_create_temporary_files_in
authorAlan Knowles <alan@roojs.com>
Wed, 16 Jan 2019 07:41:02 +0000 (15:41 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 16 Jan 2019 07:41:02 +0000 (15:41 +0800)
src/jsdoc/DocBuilder.vala

index 56e9970..3afceb0 100644 (file)
@@ -498,6 +498,17 @@ namespace JSDOC
                {
                                var tmp = this.tempdir + GLib.Path.get_basename(fname);
                                g.to_file(tmp);
+                               
+                               if (GLib.FileUtils.test(fname, GLib.FileTest.EXISTS)) {
+                                       string new_data, old_data;
+                                       FileUtils.get_contents(tmp, out new_data);
+                                       FileUtils.get_contents(fname, out old_data);
+                                       if (old_data == new_data) {
+                                               GLib.File.new_for_path(tmp).delete();
+                                               return;
+                                       }
+                          }
+                               
                        GLib.File.new_for_path(tmp).move( File.new_for_path(fname), GLib.FileCopyFlags.OVERWRITE);
                      
                }