wip(commands): re-implement core commands as bash functions

Re-implement all libexec executables as bash functions, with the goal of
being able build a single standalone execuable bash script for
tmuxifier.
This commit is contained in:
2025-12-01 23:17:41 +00:00
parent f268c12f3f
commit b2a67705b6
8 changed files with 240 additions and 174 deletions

View File

@@ -1,30 +1,6 @@
#! /usr/bin/env bash
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
# Load internal utility functions.
source "$TMUXIFIER/lib/util.sh"
source "$TMUXIFIER/lib/load.sh"
# Provide tmuxifier help
if calling-help "$@"; then
echo "usage: tmuxifier resolve-command-path <command_or_alias>
Outputs the absolute path to the given command or command alias."
exit
fi
if [ -n "$1" ]; then
! command_path="$(command -v "tmuxifier-$1")"
if [ -z "$command_path" ]; then
resolved="$(tmuxifier-alias "$1")"
if [ -n "$resolved" ]; then
! command_path="$(command -v "tmuxifier-$resolved")"
fi
fi
fi
if [ -n "$command_path" ]; then
echo "$command_path"
else
exit 1
fi
tmuxifier-resolve-command-path "$@"