runphp peut être lancé sans projet php de support

This commit is contained in:
Jephté Clain 2024-11-08 17:10:21 +04:00
parent 10d013d3ff
commit 6e83cdb819
3 changed files with 20 additions and 13 deletions

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname -- "$0")/../load.sh" || exit 1
owd="$(pwd)"
PROJDIR=
while true; do
cwd="$(pwd)"
@ -13,12 +14,16 @@ while true; do
break
fi
if [ "$cwd" == "$HOME" -o "$cwd" == / ]; then
die "Impossible de trouver un projet PHP"
cd "$owd"
break
fi
cd ..
done
if [ "$MYNAME" == composer ]; then
if [ -z "$PROJDIR" ]; then
# s'il n'y a pas de projet, --bs est l'action par défaut
[ $# -gt 0 ] || set -- --bs
elif [ "$MYNAME" == composer ]; then
set -- composer "$@"
else
case "$1" in
@ -26,15 +31,17 @@ else
esac
fi
export RUNPHP_STANDALONE=
RUNPHP=; DIST=; REGISTRY=
if [ -f "$PROJDIR/.runphp.conf" ]; then
source "$PROJDIR/.runphp.conf"
[ -n "$RUNPHP" ] && exec "$PROJDIR/$RUNPHP" "$@"
elif [ -f "$PROJDIR/sbin/runphp" ]; then
exec "$PROJDIR/sbin/runphp" "$@"
elif [ -f "$PROJDIR/runphp" ]; then
exec "$PROJDIR/runphp" "$@"
if [ -n "$PROJDIR" ]; then
export RUNPHP_STANDALONE=
RUNPHP=; DIST=; REGISTRY=
if [ -f "$PROJDIR/.runphp.conf" ]; then
source "$PROJDIR/.runphp.conf"
[ -n "$RUNPHP" ] && exec "$PROJDIR/$RUNPHP" "$@"
elif [ -f "$PROJDIR/sbin/runphp" ]; then
exec "$PROJDIR/sbin/runphp" "$@"
elif [ -f "$PROJDIR/runphp" ]; then
exec "$PROJDIR/runphp" "$@"
fi
fi
export RUNPHP_STANDALONE="$NULIBDIR"

View File

@ -491,7 +491,7 @@ OPTIONS
# monter le répertoire qui contient $PROJDIR
mount_composer=
mount_runphp=1
if [ "${PROJDIR#$HOME/}" != "$PROJDIR" -o "$PROJDIR" == "$HOME" ]; then
if [ -z "$PROJDIR" -o "${PROJDIR#$HOME/}" != "$PROJDIR" -o "$PROJDIR" == "$HOME" ]; then
# bind mount $HOME
args+=(-v "$HOME:$HOME${UseRslave:+:rslave}")
[ -n "$RUNPHP_STANDALONE" ] &&

View File

@ -442,7 +442,7 @@ OPTIONS
# monter le répertoire qui contient $PROJDIR
mount_composer=
mount_runphp=1
if [ "${PROJDIR#$HOME/}" != "$PROJDIR" -o "$PROJDIR" == "$HOME" ]; then
if [ -z "$PROJDIR" -o "${PROJDIR#$HOME/}" != "$PROJDIR" -o "$PROJDIR" == "$HOME" ]; then
# bind mount $HOME
args+=(-v "$HOME:$HOME${UseRslave:+:rslave}")
[ -n "$RUNPHP_STANDALONE" ] &&