forked from KoljaWindeler/XN986
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk.cleanup
executable file
·50 lines (44 loc) · 1.09 KB
/
sdk.cleanup
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
#!/bin/sh
source script_lib/script.lib
ECHO "Cleanup SDK" COLOR_YELLOW
if [ "$#" -eq "0" ]
then
WARN "ALL THE SOUCE FILES WILL BE DELETED, FILES YOU MOTIFIED WILL BE LOST !!!"
ECHO ""
ECHO "To continue, type 'y' or 'Y' and then press ENTER ..."
read choice
if [ $choice != Y ] && [ $choice != y ]
then
exit 1;
fi
run_command "rm snx_sdk -frv" 0 "find snx_sdk | wc -l"
exit 0
elif [ "$#" -eq "2" ]
then
search_path="snx_sdk/$2"
pushd $search_path >/dev/null
module_path=`find ./ -name "$1" -print`
elif [ "$#" -eq "1" ]
then
search_path="snx_sdk"
pushd $search_path >/dev/null
module_path=`find ./ -maxdepth 1 -name "$1" -print`
else
ERR "wrong params !!!"
exit 1
fi
if [ -z "$module_path" ]
then
ERR "Wrong module path $search_path/$1 !!!"
exit 1
fi
WARN "THE MODULE $search_path/$1 FILES WILL BE DELETED, FILES YOU MOTIFIED WILL BE LOST !!!"
ECHO ""
ECHO "To continue, type 'y' or 'Y' and then press ENTER ..."
read choice
if [ $choice != Y ] && [ $choice != y ]
then
exit 1;
fi
run_command "rm $module_path -frv" 0 "find $module_path | wc -l"
popd >/dev/null