flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [03/10] git commit: [flex-utilities] [refs/heads/feature/flash-downloader] - npm-flexjs: batch files get CRLF and other files get LF in js/bin
Date Thu, 06 Oct 2016 13:48:08 GMT
npm-flexjs: batch files get CRLF and other files get LF in js/bin


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/1cd590f2
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/1cd590f2
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/1cd590f2

Branch: refs/heads/feature/flash-downloader
Commit: 1cd590f2d5f136af27dc8f778af9d11f75d1df5c
Parents: 1bd9060
Author: Josh Tynjala <joshtynjala@apache.org>
Authored: Wed Aug 17 14:21:52 2016 -0700
Committer: Josh Tynjala <joshtynjala@apache.org>
Committed: Wed Aug 17 14:21:52 2016 -0700

----------------------------------------------------------------------
 npm-flexjs/dependencies/download_dependencies.js | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/1cd590f2/npm-flexjs/dependencies/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/download_dependencies.js b/npm-flexjs/dependencies/download_dependencies.js
index 851e041..d71996d 100644
--- a/npm-flexjs/dependencies/download_dependencies.js
+++ b/npm-flexjs/dependencies/download_dependencies.js
@@ -57,14 +57,18 @@ function updateScriptEOL()
         do
         {
             var filePath = files.shift();
-            if(path.extname(filePath) !== '')
-            {
-                //skip windows batch files
-                continue;
-            }
             filePath = path.resolve(dirPath, filePath);
             var data = fs.readFileSync(filePath, {encoding: 'utf8'});
-            data = eol.lf(data);
+            if(path.extname(filePath) === '.bat')
+            {
+                //windows scripts
+                data = eol.crlf(data);
+            }
+            else
+            {
+                //mac, linux, or cygwin scripts
+                data = eol.lf(data);
+            }
             fs.writeFileSync(filePath, data, {encoding: 'utf8', mode: 0o755});
         }
         while(files.length > 0)


Mime
View raw message