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

test() does not support -w and -x options #768

Closed
dundalek opened this issue Sep 6, 2017 · 3 comments
Closed

test() does not support -w and -x options #768

dundalek opened this issue Sep 6, 2017 · 3 comments
Labels

Comments

@dundalek
Copy link

dundalek commented Sep 6, 2017

These are sometimes useful and are not supported as of latest shelljs (v0.7.8):

  • -w file exists and write permission is granted
  • -x file exists and execute permission is granted

Usage:

require('shelljs').test('-x', '/bin/bash')
// => test: option not recognized: x

It can be implemented using fs.accessSync. Would you be interested in a PR?

@nfischer
Copy link
Member

nfischer commented Sep 7, 2017

@dundalek that approach SGTM as long as we can support Windows. We unfortunately had to drop a lot of chmod support because Windows handles modes very differently. Take a look at test/chmod.js for all the skipOnWin tests.

Feel free to send a PR with tests. Appveyor will verify if the feature works for Windows.

@dundalek
Copy link
Author

dundalek commented Sep 8, 2017

Yeah, good point. It would do nothing on windows, nevermind.

@dundalek dundalek closed this as completed Sep 8, 2017
@nfischer
Copy link
Member

nfischer commented Sep 8, 2017

Maybe -w is ok? It seems to be allowed on Windows.

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