(a: string, b: string)
| 179 | /^(setup|sessionstart|cwdchanged|filechanged)-hook-(\d+)\.sh$/ |
| 180 | |
| 181 | function sortHookEnvFiles(a: string, b: string): number { |
| 182 | const aMatch = a.match(HOOK_ENV_REGEX) |
| 183 | const bMatch = b.match(HOOK_ENV_REGEX) |
| 184 | const aType = aMatch?.[1] || '' |
| 185 | const bType = bMatch?.[1] || '' |
| 186 | if (aType !== bType) { |
| 187 | return (HOOK_ENV_PRIORITY[aType] ?? 99) - (HOOK_ENV_PRIORITY[bType] ?? 99) |
| 188 | } |
| 189 | const aIndex = parseInt(aMatch?.[2] || '0', 10) |
| 190 | const bIndex = parseInt(bMatch?.[2] || '0', 10) |
| 191 | return aIndex - bIndex |
| 192 | } |
nothing calls this directly
no outgoing calls
no test coverage detected