-
Notifications
You must be signed in to change notification settings - Fork 52
/
installhowtos.sh
53 lines (49 loc) · 1.46 KB
/
installhowtos.sh
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
53
#! /usr/bin/env bash
set -e
script="$(dirname "$(readlink -f "$0")")"
source "$script/scripts/inst.sh"
echo "Installing for 3ds Max version: $version. If this is not correct please set the VERSION environment variable before runnning the script. (ex: VERSION=2022)"
# make sure cygpath is available
if ! command -v cygpath >/dev/null 2>&1
then
exiterr "cygpath needs to be in the path."
fi
# make sure cmd is available
if ! command -v cmd >/dev/null 2>&1
then
exiterr "cmd needs to be in the path."
fi
venvscript () {
echo "cd Scripts"
echo "call activate.bat"
for f in $(find "$packagedir" -name "setup.py")
do
local package="$(dirname "$f")"
echo "pip.exe install -e \"$(cygpath -d "$package")\""
done
}
set -e
if [ -f "Scripts/activate.bat" ]
then
# this is a virtual env
echo "install python packages in virtual env"
read -p "Is this what you want (Y/n)? " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
tmpfile="$(mktemp /tmp/XXXXXXX.bat)"
venvscript > "$tmpfile"
cmd //C "$tmpfile"
rm "$tmpfile"
fi
elif [ -f ./3dsmax.exe ]
then
# this is the default installation
echo "install python packages in your account with --user (not in a virtual env)"
read -p "Is this what you want (Y/n)? " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
installpythonpackages
fi
else
exiterr "This script must run in a 3ds Max installation directory or in a virtual environment directory.."
fi