-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMasterTwoUnInstall
More file actions
40 lines (31 loc) · 1.1 KB
/
MasterTwoUnInstall
File metadata and controls
40 lines (31 loc) · 1.1 KB
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
#!/bin/bash
SabineFiles="Fermions.m Integrals.m MasterTwo.m "
MasterTwoExecutables=" $PWD/MasterTwoUnInstall $PWD/MasterTwoInstall $PWD/MasterTwoUnInstall_MacOs $PWD/MasterTwoInstall_MacOs $PWD/MasterTwoWebpage.html"
AdditionalFiles="$PWD/Readme.txt $PWD/Example.nb $PWD/Manual_MasterTwo.pdf"
filestodelete="$SabineFiles $MasterTwoExecutables $AdditionalFiles"
initmdir=$HOME/.Mathematica/Autoload
initm=$initmdir/init.m
echo -n "Are you sure you want to uninstall the package MasterTwo? "
read response
echo
case $response in
y | yes | ja | si | oui | sure) [ -e $initm ] && sed "/begin of the lines added by MasterTwo/,/end of the lines added by MasterTwo/{d}" $initm >MasterTwo.init.m.temp
cp MasterTwo.init.m.temp $initm
rm MasterTwo.init.m.temp ;;
*) exit 0
esac
echo
echo "Should the files of the directory"
echo $PWD
echo -n "be deleted ? "
read reply
case $reply in
y | yes | ja | si | oui | sure)
rm $filestodelete
for dir in `ls -rdx [0-9]*`;
do
rm ./$dir/*
rmdir $dir
done ;;
*) echo "uninstall finished whitout removing files"; exit 0
esac