-
Notifications
You must be signed in to change notification settings - Fork 52
/
uninstallhowtos.sh
40 lines (37 loc) · 1.04 KB
/
uninstallhowtos.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
#! /usr/bin/env bash
set -e
script="$(dirname "$(readlink -f "$0")")"
source "$script/scripts/inst.sh"
venvscript () {
echo "cd Scripts"
echo "call activate.bat"
for f in $(find "$packagedir" -name "setup.py")
do
local package="$(basename "$(dirname "$f")")"
echo "pip.exe uninstall -y $package-autodesk"
done
}
if [ -f "Scripts/activate.bat" ]
then
# this is a virtual env
echo "unininstall python packages from 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 "uininstall python packages from your user account"
read -p "Is this what you want (Y/n)? " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
uninstallpythonpackages
fi
else
exiterr "This script must run in a 3ds Max installation directory or in a virtual environment directory."
fi