MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isRunningFromBuildDirectory

Function isRunningFromBuildDirectory

src/utils/warningHandler.ts:16–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14// Check if running from a build directory (development mode)
15// This is a sync version of the logic in getCurrentInstallationType()
16function isRunningFromBuildDirectory(): boolean {
17 let invokedPath = process.argv[1] || ''
18 let execPath = process.execPath || process.argv[0] || ''
19
20 // On Windows, convert backslashes to forward slashes for consistent path matching
21 if (getPlatform() === 'windows') {
22 invokedPath = invokedPath.split(win32.sep).join(posix.sep)
23 execPath = execPath.split(win32.sep).join(posix.sep)
24 }
25
26 const pathsToCheck = [invokedPath, execPath]
27 const buildDirs = [
28 '/build-ant/',
29 '/build-external/',
30 '/build-external-native/',
31 '/build-ant-native/',
32 ]
33
34 return pathsToCheck.some(path => buildDirs.some(dir => path.includes(dir)))
35}
36
37// Warnings we know about and want to suppress from users
38const INTERNAL_WARNINGS = [

Callers 1

initializeWarningHandlerFunction · 0.85

Calls 1

getPlatformFunction · 0.85

Tested by

no test coverage detected