You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by de...@apache.org on 2012/04/30 18:46:30 UTC

js commit: CB-605 Only write style changes on build if modification made.

Updated Branches:
  refs/heads/master 5605e656f -> cb7a4c7a4


CB-605 Only write style changes on build if modification made.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/cb7a4c7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/cb7a4c7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/cb7a4c7a

Branch: refs/heads/master
Commit: cb7a4c7a4a680eccaef768a2e0c6e4631d39fcaf
Parents: 5605e65
Author: Drew Walters <de...@gmail.com>
Authored: Mon Apr 30 11:45:33 2012 -0500
Committer: Drew Walters <de...@gmail.com>
Committed: Mon Apr 30 11:45:33 2012 -0500

----------------------------------------------------------------------
 Jakefile |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/cb7a4c7a/Jakefile
----------------------------------------------------------------------
diff --git a/Jakefile b/Jakefile
index 043bc44..20f0c63 100644
--- a/Jakefile
+++ b/Jakefile
@@ -124,7 +124,7 @@ task('fixwhitespace', function() {
         if (rexp_minified.test(file) || !rexp_src.test(file)) {
             cbDone();
         } else {
-            var src = fs.readFileSync(file, 'utf8');
+            var origsrc = src = fs.readFileSync(file, 'utf8');
 
             // tabs -> four spaces
             if (src.indexOf('\t') >= 0) {
@@ -134,8 +134,10 @@ task('fixwhitespace', function() {
             // eliminate trailing white space
             src = src.replace(/ +\n/g, '\n');
 
-            // write it out yo
-            fs.writeFileSync(file, src, 'utf8');
+            if (origsrc !== src) {
+                // write it out yo
+                fs.writeFileSync(file, src, 'utf8');
+            }
             cbDone();
         }
     }, complete);