For cmd/PowerShell, I think the bat files will be required.

Anyway, I just tweaked the code to read all of the files in the directory.
If a file doesn't have an extension, I apply the line ending fix. When bat
files are added in the future, they'll be skipped and keep their line
endings (though maybe they should be forced to have CRLF...).

- Josh

On Wed, Aug 17, 2016 at 1:10 PM, OmPrakash Muppirala <bigosma...@gmail.com>
wrote:

> No, it does not work on cmd or powershell.  If I remember correctly, this
> only worked on Cygwin for me.  I was hoping to add cmd/powershell support
> at a later point.
>
> On Wed, Aug 17, 2016 at 12:39 PM, OmPrakash Muppirala <
> bigosma...@gmail.com>
> wrote:
>
> > On Wed, Aug 17, 2016 at 12:37 PM, Josh Tynjala <joshtynj...@gmail.com>
> > wrote:
> >
> >> So these scripts work correctly in PowerShell and cmd?
> >>
> >>
> > <Runs to go check>
> >
> >
> >> - Josh
> >>
> >> On Wed, Aug 17, 2016 at 12:28 PM, OmPrakash Muppirala <
> >> bigosma...@gmail.com>
> >> wrote:
> >>
> >> > I don't think we will be adding bat files here.  The idea is to be
> able
> >> to
> >> > run the same file on either platform so that they can be integrated
> into
> >> > other flows.  At least, that is the current thinking.
> >> >
> >> > Thanks,
> >> > Om
> >> >
> >> > On Wed, Aug 17, 2016 at 12:21 PM, Josh Tynjala <joshtynj...@gmail.com
> >
> >> > wrote:
> >> >
> >> > > I assume that we plan to add .bat files for Windows at some point,
> and
> >> > > those probably need CRLF. We could check the file extension. Either
> >> skip
> >> > > .bat files or only fix files without an extension. I'm not sure
> which
> >> is
> >> > > better.
> >> > >
> >> > > - Josh
> >> > >
> >> > > On Wed, Aug 17, 2016 at 12:01 PM, OmPrakash Muppirala <
> >> > > bigosma...@gmail.com>
> >> > > wrote:
> >> > >
> >> > > > On Wed, Aug 17, 2016 at 10:28 AM, <joshtynj...@apache.org> wrote:
> >> > > >
> >> > > > > Repository: flex-utilities
> >> > > > > Updated Branches:
> >> > > > >   refs/heads/develop e5c3d36e0 -> 59664053c
> >> > > > >
> >> > > > >
> >> > > > > npm-flexjs: changes line ending of scripts to LF because CRLF
> does
> >> > not
> >> > > > > work on Mac, causing bad interpreter: No such file or directory
> >> error
> >> > > > >
> >> > > > >
> >> > > > > Project: http://git-wip-us.apache.org/r
> >> epos/asf/flex-utilities/repo
> >> > > > > Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/
> >> > > > > commit/59664053
> >> > > > > Tree: http://git-wip-us.apache.org/
> repos/asf/flex-utilities/tree/
> >> > > > 59664053
> >> > > > > Diff: http://git-wip-us.apache.org/
> repos/asf/flex-utilities/diff/
> >> > > > 59664053
> >> > > > >
> >> > > > > Branch: refs/heads/develop
> >> > > > > Commit: 59664053cea8436c2d4a6f0b7df10c619f040826
> >> > > > > Parents: e5c3d36
> >> > > > > Author: Josh Tynjala <joshtynj...@apache.org>
> >> > > > > Authored: Wed Aug 17 10:28:19 2016 -0700
> >> > > > > Committer: Josh Tynjala <joshtynj...@apache.org>
> >> > > > > Committed: Wed Aug 17 10:28:19 2016 -0700
> >> > > > >
> >> > > > > ------------------------------------------------------------
> >> > ----------
> >> > > > >  .../dependencies/download_dependencies.js       | 29
> >> > > > ++++++++++++++++++++
> >> > > > >  npm-flexjs/package.json                         |  1 +
> >> > > > >  2 files changed, 30 insertions(+)
> >> > > > > ------------------------------------------------------------
> >> > ----------
> >> > > > >
> >> > > > >
> >> > > > > http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/
> >> > > > > 59664053/npm-flexjs/dependencies/download_dependencies.js
> >> > > > > ------------------------------------------------------------
> >> > ----------
> >> > > > > diff --git a/npm-flexjs/dependencies/download_dependencies.js
> >> > > > > b/npm-flexjs/dependencies/download_dependencies.js
> >> > > > > index e8fa370..3858049 100644
> >> > > > > --- a/npm-flexjs/dependencies/download_dependencies.js
> >> > > > > +++ b/npm-flexjs/dependencies/download_dependencies.js
> >> > > > > @@ -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'
> >> > > > > +        ];
> >> > > > >
> >> > > >
> >> > > > Since we are running this first, can we safely assume that all the
> >> > files
> >> > > > that are under js/bin need to be fixed?  That way, any new files
> >> added
> >> > > > later will not require a code change here.
> >> > > >
> >> > > > Thanks,
> >> > > > Om
> >> > > >
> >> > > >
> >> > > >
> >> > > > > +        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
> >> > > > >
> >> > > > > http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/
> >> > > > > 59664053/npm-flexjs/package.json
> >> > > > > ------------------------------------------------------------
> >> > ----------
> >> > > > > diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
> >> > > > > index 6181aea..0fd08b3 100644
> >> > > > > --- a/npm-flexjs/package.json
> >> > > > > +++ b/npm-flexjs/package.json
> >> > > > > @@ -16,6 +16,7 @@
> >> > > > >    "author": "OmPrakash Muppirala <bigosma...@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",
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> >
> >
>

Reply via email to