Skip to content

Commit

Permalink
npm-flexjs: batch files get CRLF and other files get LF in js/bin
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Aug 17, 2016
1 parent 1bd9060 commit 1cd590f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions npm-flexjs/dependencies/download_dependencies.js
Expand Up @@ -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)
Expand Down

0 comments on commit 1cd590f

Please sign in to comment.