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/..\"'"
;;
@ -354,31 +365,36 @@ case "${1}" in
"Available commands:" "" ""\
"" "" "" \
"runtipi" "" ""\
"" "cli" "runtipi-cli" \
"" "log" "runtipi docker stack logs" \
"" "start" "start runtipi" \
"" "update" "update runtipi to a specific version" \
"" "cli" "runtipi-cli" \
"" "log" "runtipi docker stack logs" \
"" "start" "start runtipi" \
"" "update" "update runtipi to a specific version" \
"" "" "" \
"docker/docker-compose" "" ""\
"" "tpcompose" "docker compose for runtipi apps" \
"" "ixcompose" "docker compose for ix/TrueNAS SCALE docker based app" \
"" "ls" "list applications (or contrainers)" \
"" "dls" "stylized docker ls" \
"" "shell" "enter an insteractive shell" \
"" "down-all" "stop and remove everything" \
"" "tpcompose" "docker compose for runtipi apps" \
"" "ixcompose" "docker compose for ix/TrueNAS SCALE docker based app" \
"" "ls" "list applications (or contrainers)" \
"" "dls" "stylized docker ls" \
"" "shell" "enter an insteractive shell" \
"" "down-all" "stop and remove everything" \
"" "" "" \
"networking" "" ""\
"" "ipvlan" "manage ipvlan networking interface fix" \
"" "ipvlan" "manage ipvlan networking interface fix" \
"" "" "" \
"misc." "" ""\
"" "exec" "execute within the shell, START_DIR env applies" \
"" "exec" "execute within the shell, START_DIR env applies" \
"" "" "" \
"" "setup" "setup runtipictl in user's .local/bin dir" \
"" "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" ""
;;