-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-channeltinkergimp2.sh
executable file
·48 lines (47 loc) · 1.74 KB
/
setup-channeltinkergimp2.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
#!/bin/bash
VERY_OLD_MODULE_NAME=channeltinkergimp
MODULE_NAME=channeltinkergimp2
if [ ! -f rotocanvas/__init__.py ]; then
if [ -d ~/git/rotocanvas ]; then
cd ~/git/rotocanvas
fi
fi
if [ ! -f rotocanvas/__init__.py ]; then
mkdir -p ~/git
echo "[$0] Cloning into ~/git/rotocanvas..."
git clone https://github.com/Hierosoft/rotocanvas.git ~/git/rotocanvas
cd ~/git/rotocanvas || exit $?
fi
if [ -f ~/.config/GIMP/2.10/plug-ins/channel_tinker.py ]; then
rm ~/.config/GIMP/2.10/plug-ins/channel_tinker.py || exit $?
fi
if [ -f ~/.config/GIMP/2.10/plug-ins/$MODULE_NAME.py ]; then
rm ~/.config/GIMP/2.10/plug-ins/$MODULE_NAME.py || exit $?
fi
if [ -f ~/.config/GIMP/2.10/plug-ins/$VERY_OLD_MODULE_NAME.py ]; then
rm ~/.config/GIMP/2.10/plug-ins/$VERY_OLD_MODULE_NAME.py || exit $?
fi
if [ -d ~/.config/GIMP/2.10/plug-ins/channel_tinker ]; then
if [ -L ~/.config/GIMP/2.10/plug-ins/channel_tinker ]; then
# symlink
rm ~/.config/GIMP/2.10/plug-ins/channel_tinker
else
rm -Rf ~/.config/GIMP/2.10/plug-ins/channel_tinker
fi
fi
if [ -d ~/.config/GIMP/2.10/plug-ins/channeltinker ]; then
if [ -L ~/.config/GIMP/2.10/plug-ins/channeltinker ]; then
# symlink
rm ~/.config/GIMP/2.10/plug-ins/channeltinker
else
rm -Rf ~/.config/GIMP/2.10/plug-ins/channeltinker
fi
fi
cp -R channeltinker ~/.config/GIMP/2.10/plug-ins/
cp $MODULE_NAME.py ~/.config/GIMP/2.10/plug-ins/
chmod +x ~/.config/GIMP/2.10/plug-ins/$MODULE_NAME.py
echo "[$0] Installed ~/.config/GIMP/2.10/plug-ins/$MODULE_NAME.py"
# or
# ln -s ~/git/rotocanvas/$MODULE_NAME.py ~/.config/GIMP/2.10/plug-ins/
# ln -s ~/git/rotocanvas/channeltinker ~/.config/GIMP/2.10/plug-ins/
# ls -l ~/.config/GIMP/2.10/plug-ins/channeltinker