fix mgmt for termux
This commit is contained in:
parent
074131bb54
commit
21127d307d
4 changed files with 15 additions and 8 deletions
12
private_bin/private_mgmt → private_bin/private_executable_mgmt
Executable file → Normal file
12
private_bin/private_mgmt → private_bin/private_executable_mgmt
Executable file → Normal file
|
|
@ -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 "$@"
|
||||
|
||||
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; } }
|
||||
3
private_dot_config/private_git/private_config
Normal file
3
private_dot_config/private_git/private_config
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[user]
|
||||
email = contact@rperce.net
|
||||
name = Robert Perce
|
||||
|
|
@ -1 +1,3 @@
|
|||
git
|
||||
make
|
||||
nvim; termux:neovim arch:neovim ubuntu:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue