| 191 | } |
| 192 | |
| 193 | function 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 | |
| 207 | export function extractCommandArguments(commandNode: Node): string[] { |
| 208 | // Declaration commands |