summaryrefslogtreecommitdiff
path: root/Build/source/texk/gregorio/gregorio-src/contrib/TeXShop/auto-configure.command
blob: 065871932ee8395d4ddec9385ae0e9bb8ec8cfa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash

# This script is designed to automatically configure a TeXShop distribution.
# You should be able to direct it to run by double clicking on it.

#This trap combination allows the window to linger long enough for the user to
#inspect the output, but still get closed when all is said and done.
function quit {
    read -n1 -r -p "Press any key to close window." key
    osascript -e 'tell application "Terminal" to close front window' > /dev/null 2>&1 &
}

trap quit EXIT


#Copy the engine file from its instalation directory to the TeXShop Engines directory
ENGINEDIR="$HOME/Library/TeXShop/Engines"
if [ ! -d "$ENGINEDIR" ]; then
    echo "Cannot Find TeXShop configuration directory!"
    echo "Please open and close TeXShop and try running this script again."
    exit 1
fi
SOURCE="/Users/Shared/Gregorio/contrib/TeXShop/LuaLaTeX+se.engine"
if [ -e "$SOURCE" ]; then
    echo "Copying LuaLaTeX+se.engine into TeXShop configuration"
    cp "$SOURCE" "$ENGINEDIR"
else
    echo "Cannot find LuaLaTeX+se.engine"
    echo "Please try running the Gregorio intaller again"
    exit 1
fi
SOURCE="/Users/Shared/Gregorio/contrib/TeXShop/LuaTeX+se.engine"
if [ -e "$SOURCE" ]; then
    echo "Copying LuaTeX+se.engine into TeXShop configuration"
    cp "$SOURCE" "$ENGINEDIR"
else
    echo "Cannot find LuaTeX+se.engine"
    echo "Please try running the Gregorio intaller again"
    exit 1
fi

echo "Configuration complete"
exit 0