Add git command + --debug and additional usage

This commit is contained in:
Lockszmith (@Kateryna) 2025-03-16 00:05:42 -04:00
parent d6c9475600
commit fc682920ed
1 changed files with 29 additions and 13 deletions

View File

@ -280,6 +280,12 @@ manage-ipvlan() {
# ip link show [ DEVICE | group GROUP ] [up] [master DEV] [vrf NAME] [type TYPE] [nomaster]
}
if [ "${1}" == '--debug' ]; then
shift
set -x
fi
case "${1}" in
cli)
runtipi-cli "${@:2}"
@ -342,6 +348,11 @@ case "${1}" in
editme)
${VISUAL:-${EDITOR:-vi}} "$(readlink -f "$0")"
;;
git)
GIT_ARGS="$( printf '"%s" ' "${@:2}" )"
[ "$GIT_ARGS" != '"update"' ] || GIT_ARGS="pull --rebase --autostash"
exec sh -c 'cd user-config && git '"${GIT_ARGS}"'; exit $?'
;;
_load)
echo "alias ${BASE_NAME}cd='cd \"$SCRIPT_DIR/..\"'"
;;
@ -376,9 +387,14 @@ case "${1}" in
"" "setup" "setup runtipictl in user's .local/bin dir" \
"" "" "${BASE_NAME} setup" \
"" "" "${BASE_NAME} setup '' ~/.local/bin/${BASE_BASE_NAME}" \
"" "" "${BASE_NAME} setup '' ~/.local/bin/tpc" \
"" "" "${BASE_NAME} setup '' ~/.local/bin/runtipictl" \
"" "" "" \
"" "editme" "Open the script in the EDITOR" \
"" "git [update]" "Perform git operations on user-config," \
"" "" "update sub-command is a shortcut to pull --autostash --rebase" \
"Related env. vars:" "" "" \
"" "" "" \
"" "VISUAL EDITOR RPH_UID QUIET START_DIR ROOT_EXEC" ""
;;