forked from jetsonhacks/buildOpenCVXavier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
removeOpenCVSources.sh
executable file
·55 lines (47 loc) · 1.33 KB
/
removeOpenCVSources.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
54
#!/bin/bash
# License: MIT. See license file in root directory
# Copyright(c) JetsonHacks (2017-2018)
# Default installation is in the $HOME directory
OPENCV_SOURCE_DIR=$HOME
function usage
{
echo "usage: ./removeOpenCVSources.sh [[-s sourcedir ] | [-h]]"
echo "-d | --directory Directory from which to remove the opencv sources (default $HOME)"
echo "-h | --help This message"
}
# Iterate through command line inputs
while [ "$1" != "" ]; do
case $1 in
-d | --directory ) shift
OPENCV_SOURCE_DIR=$1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
echo "Removing opencv directory from $OPENCV_SOURCE_DIR"
cd $OPENCV_SOURCE_DIR
if [ -d "opencv" ] ; then
if [ -L "opencv" ] ; then
echo "opencv is a symlink, unable to remove"
else
echo "Removing opencv sources"
sudo rm -r opencv
fi
else
echo "Could not find opencv directory"
fi
if [ -d "opencv_extra" ] ; then
if [ -L "opencv_extra" ] ; then
echo "opencv_extra is a symlink, unable to remove"
else
echo "Removing opencv_extra sources"
sudo rm -r opencv_extra
fi
else
echo "Could not find opencv_extra directory"
fi