I want use ./src/**/*.js to match every js file in ./src folder,no matter how deep the file path is.
so I run ls ./src/**/*.js in the shell and the wildcards behave as I expected, js files like ./src/path1/a.js ./src/path1/path2/b.js and both matched.
And then I add npm script in package.json
{
scripts: {
"test": "ls ./src/**/*.js"
}
}
run npm run test. But now only files like ./src/pah1/a.js are matched.
I don't know why same wildcards behave differently.Can anyone tell me what is the right wildcards that I can use to match every js files in one folder.
Thank you.
They're just different. Shells don't expand **. Try find ./src -name '*.js', instead.