| 9 | const LOCAL_SETTINGS_DISPLAY_PATH = '.ncode/settings.local.json' |
| 10 | |
| 11 | function hasHooks(settings: SettingsJson | null): boolean { |
| 12 | if (settings === null || settings.disableAllHooks) { |
| 13 | return false |
| 14 | } |
| 15 | if (settings.statusLine?.type === 'command') { |
| 16 | return true |
| 17 | } |
| 18 | if (settings.fileSuggestion) { |
| 19 | return true |
| 20 | } |
| 21 | if (!settings.hooks) { |
| 22 | return false |
| 23 | } |
| 24 | for (const hookConfig of Object.values(settings.hooks)) { |
| 25 | if (hookConfig.length > 0) { |
| 26 | return true |
| 27 | } |
| 28 | } |
| 29 | return false |
| 30 | } |
| 31 | |
| 32 | export function getHooksSources(): string[] { |
| 33 | const sources: string[] = [] |