]> git.lyx.org Git - features.git/blobdiff - development/MacOSX/lyxeditor
#10762 read complete answer from LyX server and echo it
[features.git] / development / MacOSX / lyxeditor
index d08cdd2cf8c9883932b210aa60385830af33c805..aeb6370dfd7732010b5a73148da2fe9f2f1a1a09 100755 (executable)
@@ -39,8 +39,8 @@ test -d "${USER_SUPPORT}" || {
        exit 1
 }
 
-# we prefere newer lyx releases here... the last should catch all
-for LYXDIR in LyX-2.0* LyX-2* LyX-1.6* LyX-1.5* LyX-1.4* LyX*
+# we prefer newer lyx releases here...
+for LYXDIR in LyX-2.4 LyX-2.3 LyX-2.2 LyX-2.1 LyX-2.0 LyX-1.6 LyX-1.5 LyX-1.4 LyX
 do
        ABS_USER_LYXDIR="${USER_SUPPORT}/${LYXDIR}"
        test -d "${ABS_USER_LYXDIR}" || {
@@ -53,9 +53,9 @@ do
        }
        # preferences file exists.
        # See if it contains a \\serverpipe entry
-       # Whether it does or not, break out of the loop because we've
-       # found the preferences file.
        LYXPIPE=$(parse_serverpipe "${PREFERENCES}")
+       # break if pipe entry and pipe detected
+       # hopefully it's the correct LyX instance...
        if [ -n "$LYXPIPE" -a -p "$LYXPIPE".in ]; then
                break
        fi
@@ -86,7 +86,9 @@ if [ -n "$LYXPIPE" -a -p "$LYXPIPE".in ]; then
        MAC_LYXPIPE_CONTENTS="LYXCMD:macdvix:server-goto-file-row:$file $2"
        # echo "$MAC_LYXPIPE_CONTENTS"
        echo "$MAC_LYXPIPE_CONTENTS" > "${LYXPIPE}".in || { echo "Cannot write to lyxpipe." ; exit 2 ; }
-       read < "${LYXPIPE}".out || { echo "Cannot read from lyxpipe." ; exit 2 ; }
+       while read line < "${LYXPIPE}".out ; do
+               echo LyX said: $line
+       done || { echo "Cannot read from lyxpipe." ; exit 2 ; }
 else
        echo "Our best guess sets lyxpipe as ${LYXPIPE}"
        echo "But the lyxpipe could not be found."