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

Function extractEnvVars

src/utils/bash/parser.ts:193–205  ·  view source on GitHub ↗
(commandNode: Node | null)

Source from the content-addressed store, hash-verified

191}
192
193function extractEnvVars(commandNode: Node | null): string[] {
194 if (!commandNode || commandNode.type !== 'command') return []
195
196 const envVars: string[] = []
197 for (const child of commandNode.children) {
198 if (child.type === 'variable_assignment') {
199 envVars.push(child.text)
200 } else if (child.type === 'command_name' || child.type === 'word') {
201 break
202 }
203 }
204 return envVars
205}
206
207export function extractCommandArguments(commandNode: Node): string[] {
208 // Declaration commands

Callers 1

parseCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected