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

fta-cli runs into line ending issue via bunx #130

Open
fucksophie opened this issue May 22, 2024 · 3 comments
Open

fta-cli runs into line ending issue via bunx #130

fucksophie opened this issue May 22, 2024 · 3 comments

Comments

@fucksophie
Copy link

Hello, this issue is really simple. Hopefully it's fixed soon.

/usr/bin/env: ‘node\r’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

The \r indicates that the shebang's newline is using CRLF's, which are opposite to Linux's LF's.
To fix this, you have to run dos2unix ./node_modules/fta-cli/index.js.

@sgb-io
Copy link
Owner

sgb-io commented May 26, 2024

Hey @fucksophie, we have e2e tests that test the built package on ubuntu and it seems to work ok. I also just tested on Ubuntu myself manually via npx (v2.0.0). (command used: npx fta-cli example-dir)

Can you confirm how you are using fta & what OS this is happening on?

@fucksophie
Copy link
Author

fucksophie commented May 27, 2024

As indicated in the issue report, this is Linux. The fta-cli index.js uses CRLFs, and this doesn't work on linux. You can see the bug in action here: https://git.sad.ovh/sophie/trillium/actions/runs/1

Sidenote: I am using bunx.

@sgb-io
Copy link
Owner

sgb-io commented May 27, 2024

Thanks. It looks like this is specific to Bun, not linux:

root@DESKTOP-G5OFQHB:~# npx fta-cli fta-test
┌─────────────────────────────────┬────────────┬─────────────────────────────┬────────────┐
│ File                            ┆ Num. lines ┆ FTA Score (Lower is better) ┆ Assessment │
╞═════════════════════════════════╪════════════╪═════════════════════════════╪════════════╡
│ node_modules/fta-cli/index.js   ┆ 64         ┆ 44.91                       ┆ OK         │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ node_modules/fta-cli/check.js   ┆ 29         ┆ 39.50                       ┆ OK         │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ node_modules/fta-cli/targets.js ┆ 10         ┆ 8.16                        ┆ OK         │
└─────────────────────────────────┴────────────┴─────────────────────────────┴────────────┘
3 files analyzed in 0.0019s.
root@DESKTOP-G5OFQHB:~# bunx fta-cli fta-test
/usr/bin/env: ‘node\r’: No such file or directory

I'm not sure why bun has this problem and node doesn't

@sgb-io sgb-io changed the title fta-cli does not work under Linux fta-cli runs into line ending issue via bunx May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants