Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line endings in bin/regpack #70

Closed
julien opened this issue Feb 16, 2017 · 2 comments
Closed

Line endings in bin/regpack #70

julien opened this issue Feb 16, 2017 · 2 comments
Labels
Milestone

Comments

@julien
Copy link
Contributor

julien commented Feb 16, 2017

Hi,

First thanks for this great tool.

I've had an issue on Linux (Debian stable) and mac OS when installing regpack via npm, and it took me a while to figure it out, so although this is not very important I thought I'd share, in case it can help.

First I installed regpack globally, with

[sudo] npm i -g regpack

Then tried it out

regpack input.js > output.js
#  : No such file or directory

:No such file or directory is the output and no file is created

So I removed everything, cloned the git repository and used npm link . from there ...

[sudo] npm uninstall -g regpack
git clone git@github.com/Siorki/RegPack.git
cd RegPack
npm i
[sudo] npm link .

Tried it out

regpack input.js > output.js
stats: 1897B to 1066B (-831B, -43.8%) # yay!

I didn't really understand what was going on, so once again .... uninstall everything

cd RegPack
[sudo] npm unlink .

Re-install from npm

[sudo] npm i -g regpack

I wanted to check the "filetype" of the node "binary", because I've had issues with node.js, python or other scripts before between different OS's

file ~/.nvm/versions/node/v7.5.0/lib/node_modules/regpack/bin/regpack 
/home/jc/.nvm/versions/node/v7.5.0/lib/node_modules/regpack/bin/regpack: Pascal source, ASCII text, with CRLF line terminators

CRLF line terminators? Well let's change that and see what happens next

So I decided to change that

dos2unix ~/.nvm/versions/node/v7.5.0/lib/node_modules/regpack/bin/regpack 
dos2unix: converting file /home/jc/.nvm/versions/node/v7.5.0/lib/node_modules/regpack/bin/regpack to Unix format ...

And now

regpack input.js > output.js 
stats: 1897B to 1066B (-831B, -43.8%)

The thing is if I check the file in the repository I cloned previously, ìt doesn't show exactly the same output

RegPack (master) $ file bin/regpack 
bin/regpack: Pascal source, ASCII text

no CRLF here

Maybe you could add this line in the .gitattributes to force the line endings?

bin/regpack -crlf

Cheers

@Siorki Siorki added this to the 5.0.1 milestone Feb 18, 2017
@Siorki
Copy link
Owner

Siorki commented Feb 18, 2017

Many thanks for taking the time to investigate the issue and provide a PR !

Related read for anyone interested in the issue : GitHub article on dealing with line endings

@Siorki
Copy link
Owner

Siorki commented Feb 18, 2017

PR #71 merged. Thanks again.

@Siorki Siorki closed this as completed Feb 18, 2017
@Siorki Siorki added the bug label Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants