shelljs / shx

Portable Shell Commands for Node
MIT License
1.73k stars 45 forks source link

Add ability to invert test #202

Closed funnylookinhat closed 2 years ago

funnylookinhat commented 2 years ago

Thank you for creating and maintaining this package - it is incredibly useful!

I've encountered a unique situation that I don't think is currently supported by shx (but it supported by shelljs).

I can test if a file or directory exists with the test command:

shx test -f "file"
shx test -d "directory"

But I cannot do the opposite (check if it does not exist). ShellJS supports the negation of a test, but I'm not seeing a way to do it with shx.

https://github.com/shelljs/shelljs#testexpression

nfischer commented 2 years ago

Looks like this could be a duplicate of issue #173?

funnylookinhat commented 2 years ago

Ah yes - thank you for catching that. Sorry for the duplicate issue. :-)