From 05d9ab4025eaa13014c17446e9a0d888ed9af4bc Mon Sep 17 00:00:00 2001 From: thek4n Date: Sun, 31 Mar 2024 00:40:48 +0300 Subject: [PATCH] install add recursive hooks executions --- install | 24 ++++++++++++++++++++++++ install-hooks/termux/post-install | 7 ------- 2 files changed, 24 insertions(+), 7 deletions(-) delete mode 100755 install-hooks/termux/post-install diff --git a/install b/install index 5b2c365..735752c 100755 --- a/install +++ b/install @@ -91,14 +91,38 @@ execute_pre_hook() { _execute_hook_if_executable "$1" "pre-install" } +recursive_execute_pre_hooks() { + local targetfile + for targetfile in ${TARGETS["$1"]} + do + if [ "${targetfile::1}" = "%" ]; then + recursive_execute_pre_hooks "${targetfile:1}" + execute_pre_hook "${targetfile:1}" + fi + done +} + execute_post_hook() { _execute_hook_if_executable "$1" "post-install" } +recursive_execute_post_hooks() { + local targetfile + for targetfile in ${TARGETS["$1"]} + do + if [ "${targetfile::1}" = "%" ]; then + recursive_execute_post_hooks "${targetfile:1}" + execute_post_hook "${targetfile:1}" + fi + done +} + install_target() { execute_pre_hook "$1" + recursive_execute_pre_hooks "$1" _link_files_in_sandbox ${TARGETS["$1"]} __install_from_sandbox + recursive_execute_post_hooks "$1" execute_post_hook "$1" } diff --git a/install-hooks/termux/post-install b/install-hooks/termux/post-install deleted file mode 100755 index ae2ff5f..0000000 --- a/install-hooks/termux/post-install +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -cat > "$HOME/.config/bash/bashrc.d/01_tmux.sh" << EOF -if command -v tmux 1>/dev/null && [[ -z "\$TMUX" ]] && [[ ! "\$TERM" =~ tmux ]]; then - exec tmux new -fi -EOF