MCPcopy Create free account
hub / github.com/Noumena-Network/code / isRunningFromSourceBuild

Function isRunningFromSourceBuild

src/utils/bundledMode.ts:46–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46export function isRunningFromSourceBuild(): boolean {
47 const invokedPath = process.argv[1] || ''
48 const normalizedInvokedPath = normalizeRuntimePath(invokedPath)
49 if (!normalizedInvokedPath.endsWith('/dist/cli.js')) {
50 return false
51 }
52
53 try {
54 const repoRoot = resolve(dirname(invokedPath), '..')
55 return (
56 existsSync(join(repoRoot, 'src', 'entrypoints', 'cli.tsx')) &&
57 existsSync(join(repoRoot, 'build', 'build.mjs'))
58 )
59 } catch {
60 return false
61 }
62}
63
64export function isDevelopmentLikeBuild(): boolean {
65 return (

Callers 1

isDevelopmentLikeBuildFunction · 0.85

Calls 3

existsSyncFunction · 0.90
normalizeRuntimePathFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected