You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find any way to do this in a cross-platform way. POSIX shell has the ! operator that can do that, but I couldn't find a way to do it on Windows. It could work like an exec command that negates the exit code of the execution.
Sample use case: Stop a commit using husky if any file contains string DO_NOT_COMMIT_THIS. "pre-commit": "shx not grep -rq DO_NOT_COMMIT_THIS ."
The text was updated successfully, but these errors were encountered:
I don't think this is currently possible in shx. We support shx true and shx false (and the OS will support && and ||), but I believe these are not enough to implement negation.
We could support a shx --negate flag to logically negate exit codes. Would you be interested in sending a PR? We would want to check for the flag value here:
I couldn't find any way to do this in a cross-platform way. POSIX shell has the
!
operator that can do that, but I couldn't find a way to do it on Windows. It could work like anexec
command that negates the exit code of the execution.Sample use case: Stop a commit using
husky
if any file contains stringDO_NOT_COMMIT_THIS
."pre-commit": "shx not grep -rq DO_NOT_COMMIT_THIS ."
The text was updated successfully, but these errors were encountered: