pas d'analyse d'argument pour ci, cu, composer

This commit is contained in:
Jephté Clain 2025-06-25 06:02:38 +04:00
parent 933b6cec3b
commit 599d646372

View File

@ -467,9 +467,11 @@ OPTIONS
function host_docker_run() { function host_docker_run() {
# lancer une commande avec docker # lancer une commande avec docker
if [ "$1" == composer ]; then case "$1" in
: # pas d'analyse d'argument pour composer ci|cu|composer)
else : # pas d'analyse d'argument pour les commandes composer
;;
*)
SOPTS=+w: SOPTS=+w:
LOPTS=help,chdir:,no-use-rslave LOPTS=help,chdir:,no-use-rslave
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args" args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
@ -513,7 +515,7 @@ OPTIONS
esac esac
shift shift
done done
fi esac
args=( args=(
run -it --rm run -it --rm
@ -589,43 +591,43 @@ function container_exec() {
fi fi
fi fi
if [ "$1" == composer ]; then # pour les commandes suivantes, pas d'analyse d'argument
: # pas d'analyse d'argument pour composer case "$1" in
else ci)
SOPTS=+w:
LOPTS=chdir:
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
chdir=
action=
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
-w|--chdir) shift; chdir="$1";;
*) die "$1: option non configurée";;
esac
shift
done
fi
if [ $# -eq 0 ]; then
die "no command specified"
elif [ "$1" == ci ]; then
eecho "== installing composer dependencies" eecho "== installing composer dependencies"
shift shift
composer i "$@" composer i "$@"
elif [ "$1" == cu ]; then ;;
cu)
eecho "== upgrading composer dependencies" eecho "== upgrading composer dependencies"
shift shift
composer u "$@" composer u "$@"
elif [ "$1" == composer ]; then ;;
composer)
"$@" "$@"
else ;;
if [ -n "$chdir" ]; then esac
cd "$chdir" || exit 1
fi SOPTS=+w:
exec "$@" LOPTS=chdir:
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
chdir=
action=
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
-w|--chdir) shift; chdir="$1";;
*) die "$1: option non configurée";;
esac
shift
done
[ $# -gt 0 ] || die "no command specified"
if [ -n "$chdir" ]; then
cd "$chdir" || exit 1
fi fi
exec "$@"
} }
################################################################################ ################################################################################