Open tdjastrzebski opened 4 years ago
This is a known limitation of ShellJS's find()
method. First step would be supporting the -type
flag over there. I think shx could translate "-name" to shelljs's expected syntax, similar to how we translate sed's syntax:
https://github.com/shelljs/shx/blob/7e7bf7fe136c923ab6abbc39406fb87444aaf16d/src/shx.js#L95-L100
It looks -name flag is not fully supported as well.
shx find BUILD/debug -name '*.o'
results in find: no such file or directory: -name
-name is just the default argument. Try cd BUILD/debug && shx find '**/*.o'
.
Well, yes, of course. The point, however, is still valid. -name flag is not supported.
My point above was that we could probably translate that within shx itself (merge default arg + -name
into shelljs's expected input). But there's little point for doing so right now because shell.find()
is just a wrapper around shell.ls()
(you could just use shx ls
for the same effect). If we implement -type
, then shell.find()
would bring something valuable to the table.
Any update on this? Thanks 😥
Sorry for bothering you, but does the following work?
npx shx find "scripts/**/*.sh" -exec npx shellcheck {} \;
Or there is another (supported) approach? Thanks
I just made the first attempt to use shx.
shx find BUILD/debug -type f -name '*.o'
yields find: no such file or directory: -type