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

Function hasInvalidHashBang

tools/lint-sh.mjs:48–55  ·  view source on GitHub ↗
(fd)

Source from the content-addressed store, hash-verified

46
47const expectedHashBang = Buffer.from('#!/bin/sh\n');
48async function hasInvalidHashBang(fd) {
49 const { length } = expectedHashBang;
50
51 const actual = Buffer.allocUnsafe(length);
52 await fd.read(actual, 0, length, 0);
53
54 return Buffer.compare(actual, expectedHashBang);
55}
56
57async function checkFiles(...files) {
58 const flags = FIX_MODE_ENABLED ? 'r+' : 'r';

Callers 1

checkFilesFunction · 0.85

Calls 2

compareMethod · 0.65
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…