Adapted to praat 6.0.15
[sgc2.git] / addons / Mac_install.command
blob74123ba63f34f682e1bd190f745ec109bc1e74d1
1 #!/bin/bash
2 #
3 # Copy wordlists to SpeakGoodChinese preferences directory
4 if [[ `uname` == "Darwin" ]] ; then
5 APPLICATIONPATH=`dirname "$0"`
6 cd "${APPLICATIONPATH}"
7 if [[ ${APPLICATIONPATH} =~ "Mac_install.app/Contents/Resources/Scripts" ]]; then
8 cd ../../../../
9 fi
10 if [[ -d ~/Desktop/SpeakGoodChinese2_32.app ]]; then
11 osascript -e 'tell app "Finder" to display dialog "SpeakGoodChinese2_32.app already exists at destination"'
12 elif [[ -s ./SGC2/SpeakGoodChinese2_32.app.zip ]]; then
13 unzip ./SGC2/SpeakGoodChinese2_32.app.zip -d ~/Desktop/
14 if [[ $? != 0 ]]; then
15 osascript -e 'tell app "Finder" to display dialog "Installation of SpeakGoodChinese2_32.app encountered an error"'
18 mkdir -p ~/Library/Preferences/SpeakGoodChinese2/wordlists
19 echo `pwd` >> ~/Desktop/kanweg.txt
20 cp -r wordlists/* ~/Library/Preferences/SpeakGoodChinese2/wordlists/
21 if [[ $? == 0 ]]; then
22 osascript -e 'tell app "Finder" to display dialog "Installation completed"'
23 else
24 osascript -e 'tell app "Finder" to display dialog "Installation of wordlists encountered an error"'
26 else
27 echo "THIS INSTALL SCRIPT IS ONLY FOR MACINTOSH COMPUTERS (OSX)"
28 osascript -e 'tell app "Finder" to display dialog "THIS INSTALL SCRIPT IS ONLY FOR MACINTOSH COMPUTERS (OSX)"'
30 osascript -e 'tell application "Terminal" to quit'
31 exit 0