aboutsummaryrefslogtreecommitdiff
path: root/utils/getMayaLocation.sh
blob: 2fad7d8ac1b214c803d5acf605fc9ac221127fbd (plain) (blame)
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
44
45
46
47
48
49
50
51
52
#!/bin/sh

# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962

mayaVer=$1

if [ "$mayaVer" = "" ]; then
    echo "Usage: $0 mayaVersion" >&2
    exit
fi

utilsDir=`dirname $0`
thisArch=`${utilsDir}/getarch.sh`
targetArch=${thisArch}
os=`${utilsDir}/getos.sh`

case ${os} in
    osx*)
    	case ${mayaVer} in
	    *i|*i386)
	    	targetArch=i386
		mayaVer=`echo ${mayaVer} | sed 's/i.*$//'`
		;;
	    *p|*ppc)
	    	targetArch=ppc
		mayaVer=`echo ${mayaVer} | sed 's/p.*$//'`
		;;
	esac

	mayaDir=maya${mayaVer}

	if [ ${targetArch} != ${thisArch} ]; then
	    mayaDir=${mayaDir}-${targetArch}
	fi

	if [ -r /Applications/Autodesk/${mayaDir} ]; then
	    echo "/Applications/Autodesk/${mayaDir}"
	else
	    if [ -r /Applications/Alias/${mayaDir} ]; then
		echo "/Applications/Alias/${mayaDir}"
	    else
		echo ""
	    fi
	fi
	;;
    *)
    	echo "$0: Operating system ${os} not currently supported." >&2
	echo ""
	;;
esac