* Get expected shell output for a given shell path
(shellPath)
| 69 | * Get expected shell output for a given shell path |
| 70 | */ |
| 71 | function getExpectedShellOutput(shellPath) { |
| 72 | switch (shellPath) { |
| 73 | case '/bin/sh': |
| 74 | return ['/bin/sh']; |
| 75 | case '/bin/bash': |
| 76 | return ['/bin/bash', 'bash']; |
| 77 | case 'cmd': |
| 78 | case 'cmd.exe': |
| 79 | return ['cmd', 'cmd.exe']; |
| 80 | case 'pwsh': |
| 81 | return ['pwsh']; |
| 82 | case 'powershell': |
| 83 | return ['powershell']; |
| 84 | default: |
| 85 | return [shellPath]; |
| 86 | } |
| 87 | } |
| 88 | /** |
| 89 | * Execute echo $0 command and extract the shell name from the output |
| 90 | * For Windows shells, use appropriate commands |
no outgoing calls
no test coverage detected