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

Suggestion: dash compatibility #24

Closed
umireon opened this issue Dec 19, 2016 · 8 comments
Closed

Suggestion: dash compatibility #24

umireon opened this issue Dec 19, 2016 · 8 comments

Comments

@umireon
Copy link
Contributor

umireon commented Dec 19, 2016

dash is the default implementation of /bin/sh in Debian and Ubuntu and is a POSIX-compliant shell.

Making luaver dash-compatible will elegantly solve every portability issue such as on zsh and on macOS.

I think this is easy for luaver because luaver does not heavily use bash-specific features.

@DhavalKapil
Copy link
Owner

I'll have to look into detail regarding this. Don't know much about dash.

@umireon
Copy link
Contributor Author

umireon commented Dec 19, 2016

Note that nvm, the version manager for nodejs (server side javascript) is dash-compatible and thus works on sh, bash, ksh and, zsh.
IMO this approach is best to support multiple shell environments.

@DhavalKapil
Copy link
Owner

Looks good to me. Thanks, I'll definitely look into it by next week!

@umireon
Copy link
Contributor Author

umireon commented Dec 19, 2016

So I must add a mention to shellcheck.
This is a reliable lint tool to check if the script is dash-compatible (or bash, zsh, or POSIX sh).
Bonus: there never be any escaping problem with shellcheck, since they can point out every problematic quoting.

@DhavalKapil
Copy link
Owner

I have enabled shellcheck test and edited the entire script accordingly. I'm planning to release a new version now. Let me know if you think anything else is required(especially focusing portability).

@umireon
Copy link
Contributor Author

umireon commented Jan 11, 2017

The list command will be broken if ls is aliased (#30), which is frequency true.

There still be problems such as bare cat and the dependency on the behavior which is not (probably) defined in POSIX (#29).
However, all of them except #30 is so minor that these should be disscussed after a new release.

@DhavalKapil
Copy link
Owner

I guess we are done with compatibility related changes right @umireon ?

@umireon
Copy link
Contributor Author

umireon commented Apr 8, 2017

Of course! 👍

@umireon umireon closed this as completed Apr 8, 2017
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