From 21127d307d0effd0b9226f4b932d17f95d1d412c Mon Sep 17 00:00:00 2001 From: Robert Perce Date: Fri, 30 Jan 2026 00:07:20 -0600 Subject: [PATCH] fix mgmt for termux --- .../{private_mgmt => private_executable_mgmt} | 18 ++++++++++-------- private_dot_config/private_git/private_config | 3 +++ .../private_packages.bash | 0 .../private_mgmt/private_packages | 2 ++ 4 files changed, 15 insertions(+), 8 deletions(-) rename private_bin/{private_mgmt => private_executable_mgmt} (83%) mode change 100755 => 100644 create mode 100644 private_dot_config/private_git/private_config rename private_dot_config/private_mgmt/{private_modules => private_mod}/private_packages.bash (100%) diff --git a/private_bin/private_mgmt b/private_bin/private_executable_mgmt old mode 100755 new mode 100644 similarity index 83% rename from private_bin/private_mgmt rename to private_bin/private_executable_mgmt index b4be9d5..fda0dd0 --- a/private_bin/private_mgmt +++ b/private_bin/private_executable_mgmt @@ -2,13 +2,14 @@ set -e source argparse.bash -functions=; def_arg functions f value default "${XDG_CONFIG_HOME:-"$HOME/.config"}/mgmt/functions" -modules=; def_arg modules m value default "${XDG_CONFIG_HOME:-"$HOME/.config"}/mgmt/modules" +mgmt_dir=; def_arg mgmt_dir d value default "${XDG_CONFIG_HOME:-"$HOME/.config"}/mgmt" positional=(); parse_args "$@" -while IFS= read -rd '' fnfile; do - source "$fnfile" -done < <(find "$functions" -type f -print0) +if [ -d "$mgmt_dir/fns" ]; then + while IFS= read -rd '' fnfile; do + source "$fnfile" + done < <(find "$functions" -type f -print0) +fi PREFIX="" grey() { printf "\33[37;2m%s\33[0;m" "$*"; } @@ -24,8 +25,9 @@ filter_by_args() { grep -E "$(join_by '|' "${positional[@]}")"; } ##### # Gather dependencies of (filtered) modules ##### +cd "$mgmt_dir" declare -a found_modules -mapfile -t filtered_mods < <(find "$modules" -type f | filter_by_args) +mapfile -t filtered_mods < <(find mod -type f | filter_by_args) set -- "${filtered_mods[@]}" while [ $# -gt 0 ]; do unset deps; declare -a deps @@ -73,13 +75,13 @@ done ##### # Apply modules ##### -sudo -v +command -v sudo >/dev/null && sudo -v set -- "${ordered_modules[@]}" for mod; do diag -e "\nApplying $mod" PREFIX="[$mod] " unset check_setup setup check_apply apply - source "$modules/$mod" + source "$mod" test "$(declare -F check_setup)" || { check_setup() { false ; } } test "$(declare -F check_apply)" || { check_apply() { false ; } } test "$(declare -F setup)" || { setup() { true; } } diff --git a/private_dot_config/private_git/private_config b/private_dot_config/private_git/private_config new file mode 100644 index 0000000..ebb02ca --- /dev/null +++ b/private_dot_config/private_git/private_config @@ -0,0 +1,3 @@ +[user] + email = contact@rperce.net + name = Robert Perce diff --git a/private_dot_config/private_mgmt/private_modules/private_packages.bash b/private_dot_config/private_mgmt/private_mod/private_packages.bash similarity index 100% rename from private_dot_config/private_mgmt/private_modules/private_packages.bash rename to private_dot_config/private_mgmt/private_mod/private_packages.bash diff --git a/private_dot_config/private_mgmt/private_packages b/private_dot_config/private_mgmt/private_packages index 13ce00b..9383192 100644 --- a/private_dot_config/private_mgmt/private_packages +++ b/private_dot_config/private_mgmt/private_packages @@ -1 +1,3 @@ +git +make nvim; termux:neovim arch:neovim ubuntu: