MCPcopy Create free account
hub / github.com/redis/RedisInsight / discoverAsarUnpackedDirs

Function discoverAsarUnpackedDirs

scripts/verify-native-modules-linux.js:37–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35}
36
37const discoverAsarUnpackedDirs = () => {
38 if (!hasPath(releaseDir)) {
39 return []
40 }
41
42 const unpackedCandidates = fs
43 .readdirSync(releaseDir, { withFileTypes: true })
44 .filter((entry) => entry.isDirectory() && entry.name.endsWith('-unpacked'))
45 .map((entry) => ({
46 name: entry.name,
47 asarUnpackedPath: path.join(
48 releaseDir,
49 entry.name,
50 'resources',
51 'app.asar.unpacked',
52 ),
53 }))
54 .filter((entry) => hasPath(entry.asarUnpackedPath))
55
56 const archSpecific = unpackedCandidates.filter((entry) =>
57 archMatchPattern.test(entry.name),
58 )
59
60 if (archSpecific.length) {
61 return archSpecific
62 }
63
64 return unpackedCandidates.filter(
65 (entry) => targetArch === 'x64' && entry.name === 'linux-unpacked',
66 )
67}
68
69const verifyBinaries = (config, unpackedDirs) => {
70 if (!unpackedDirs.length) {

Callers 1

Calls 1

hasPathFunction · 0.85

Tested by

no test coverage detected