fun doHookCommand()

in bunch-cli/src/main/kotlin/org/jetbrains/bunches/hooks/hooks.kt [96:109]


fun doHookCommand(settings: HooksSettings) {
    val dotGitPath = File(settings.path, ".git")
    for (type in settings.type.getTypeList()) {
        try {
            when (settings.action) {
                HookAction.INSTALL -> installHook(type, dotGitPath)
                HookAction.UNINSTALL -> uninstallHook(type, dotGitPath)
                HookAction.UPDATE -> updateHook(type, dotGitPath)
            }
        } catch (exception: LocalBunchException) {
            println(exception.message)
        }
    }
}