MCPcopy Index your code
hub / github.com/nodejs/node / findScriptFilesRecursively

Function findScriptFilesRecursively

tools/lint-sh.mjs:22–45  ·  view source on GitHub ↗
(dirPath)

Source from the content-addressed store, hash-verified

20};
21
22function* findScriptFilesRecursively(dirPath) {
23 const entries = readdirSync(dirPath, { withFileTypes: true });
24
25 for (const entry of entries) {
26 const path = join(dirPath, entry.name);
27
28 if (
29 entry.isDirectory() &&
30 entry.name !== 'build' &&
31 entry.name !== 'changelogs' &&
32 entry.name !== 'deps' &&
33 entry.name !== 'fixtures' &&
34 entry.name !== 'gyp' &&
35 entry.name !== 'inspector_protocol' &&
36 entry.name !== 'node_modules' &&
37 entry.name !== 'out' &&
38 entry.name !== 'tmp'
39 ) {
40 yield* findScriptFilesRecursively(path);
41 } else if (entry.isFile() && extname(entry.name) === '.sh') {
42 yield path;
43 }
44 }
45}
46
47const expectedHashBang = Buffer.from('#!/bin/sh\n');
48async function hasInvalidHashBang(fd) {

Callers 1

lint-sh.mjsFile · 0.85

Calls 5

readdirSyncFunction · 0.50
joinFunction · 0.50
extnameFunction · 0.50
isDirectoryMethod · 0.45
isFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…