Skip to content
Permalink
Browse files
npm-flexjs: changes line ending of scripts to LF because CRLF does no…
…t work on Mac, causing bad interpreter: No such file or directory error
  • Loading branch information
joshtynjala committed Aug 17, 2016
1 parent e5c3d36 commit 59664053cea8436c2d4a6f0b7df10c619f040826
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
@@ -21,6 +21,7 @@

var fs = require('fs');
var mkdirp = require('mkdirp');
var eol = require('eol');
var constants = require('./Constants');
var adobeair = require('./AdobeAIR');
var flashplayerglobal = require('./FlashPlayerGlobal');
@@ -30,6 +31,7 @@ var swfObject = require('./SWFObject');
var flatUI = require('./FlatUI');

var installSteps = [
updateScriptEOL,
createDownloadsDirectory,
installFlatUI,
installFlashPlayerGlobal,
@@ -45,6 +47,33 @@ function start()
installSteps[0].call();
}

function updateScriptEOL()
{
try
{
var files =
[
'js/bin/asjscnpm',
'js/bin/asjscompcnpm',
'js/bin/mxmlcnpm'
];
do
{
var file = files.shift();
var data = fs.readFileSync(file, {encoding: 'utf8'});
data = eol.lf(data);
fs.writeFileSync(file, data, {encoding: 'utf8', mode: 0o755});
}
while(files.length > 0)
}
catch(e)
{
handleAbort();
return;
}
handleInstallStepComplete();
}

function createDownloadsDirectory()
{
//Create downloads directory if it does not exist already
@@ -16,6 +16,7 @@
"author": "OmPrakash Muppirala <bigosmallm@apache.org>",
"license": "Apache-2.0",
"dependencies": {
"eol": "^0.2.0",
"fs-extra": "^0.26.3",
"merge-dirs": "^0.2.1",
"mkdirp": "^0.5.1",

0 comments on commit 5966405

Please sign in to comment.