forked from CoatiSoftware/Sourcetrail
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclean.sh
executable file
·50 lines (41 loc) · 1.52 KB
/
clean.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
#!/bin/bash
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
INFO="\033[33mInfo:\033[00m"
# Determine current platform
PLATFORM='unknown'
if [ "$(uname)" == "Darwin" ]; then
PLATFORM='MacOS'
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
PLATFORM='Linux'
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
PLATFORM='Windows'
fi
if [ $PLATFORM == "Windows" ]; then
ORIGINAL_PATH_TO_SCRIPT="${0}"
CLEANED_PATH_TO_SCRIPT="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
ROOT_DIR=`dirname "$CLEANED_PATH_TO_SCRIPT"`
else
ROOT_DIR="$( cd "$( dirname "$0" )" && pwd )"
fi
ROOT_DIR=$ROOT_DIR/..
# Enter sourcetrail root directory
cd $ROOT_DIR/
if [ $PLATFORM == "Windows" ]; then
BACKSLASHED_ROOT_DIR="${ROOT_DIR//\//\\}"
# Remove symbolic links
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win32\Debug\app\data' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win32\Debug\app\user' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win32\Release\app\data' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win32\Release\app\user' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win64\Debug\app\data' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win64\Debug\app\user' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win64\Release\app\data' &
cmd //c 'rmdir '$BACKSLASHED_ROOT_DIR'\build\win64\Release\app\user' &
fi
# Remove folders and contents
rm -rf bin/app/data/python
rm -rf build
# Remove log files
find bin/test/data/log -type f -name 'log*' -delete
echo -e $SUCCESS "clean complete"