1
0
mirror of synced 2026-01-18 01:22:09 +00:00

If lde is on path, don't bother with MAIKODIR (#478)

This commit is contained in:
Larry Masinter 2021-09-13 21:34:03 -07:00 committed by GitHub
parent c55239f744
commit 8ec1ca966d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,13 +60,11 @@ while [ "$#" -ne 0 ]; do
export LDEINIT="$2"
shift
;;
"-nogreet" | "--nogreet")
# Keep (GREET) from finding an init file
mkdir -p $MEDLEYDIR/tmp/logindir
export HOME=$MEDLEYDIR/tmp/logindir
export LOGINDIR=$MEDLEYDIR/tmp/logindir
export LDEINIT="$MEDLEYDIR/greetfiles/NOGREET"
;;
"-greet" | "--greet")
@ -133,8 +131,6 @@ while [ "$#" -ne 0 ]; do
shift
done
# not set on command line
if [ -z "$LDESRCESYSOUT" ] ; then
if [ -f "$LDEDESTSYSOUT" ] ; then
export LDESRCESYSOUT="$LDEDESTSYSOUT"
@ -149,30 +145,24 @@ if [ -z "$geometry" ] ; then
screensize="-sc 1440x900"
fi
inferred_maikodir=false
if [ -z "$MAIKODIR" ] ; then
# here we try two options relative to MEDLEYDIR: ./maiko and ../maiko
# this is highly imperfect, but the user can always set the env variables
export MAIKODIR="$MEDLEYDIR/../maiko"
if [ ! -d "$MAIKODIR" ] ; then
export MAIKODIR="$MEDLEYDIR/maiko"
fi
inferred_maikodir=true
fi
if [ ! -d "$MAIKODIR/bin" ] ; then
echo "MAIKODIR has no bin: $MAIKODIR"
if [ inferred_maikodir = true ] ; then
echo "I tried to infer it based on your working directory, but that didn't work."
echo "Try setting the MAIKODIR environment variable to the right location."
fi
exit 1
fi
# if lde is already on path, don't reset it
if ! command -v "$prog" > /dev/null 2>&1; then
# if lde is already on path, don't reset it
# otherwise check for MAIKODIR
if [ -z "$MAIKODIR" ] ; then
# try two options relative to MEDLEYDIR: ./maiko and ../maiko
MAIKODIR="$MEDLEYDIR/../maiko"
if ! command -v "$MAIKODIR/bin/osversion" > /dev/null 2>&1; then
MAIKODIR="$MEDLEYDIR/maiko"
fi
fi
if ! command -v "$MAIKODIR/bin/osversion" > /dev/null 2>&1; then
echo "Could not find 'lde' on PATH"
echo "nor MAIKODIR with 'bin/osversion' (to look for it)"
exit 1
fi
oldpath="$PATH"
oldpwd=`pwd`
PATH=.:"$PATH"