-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathrepair.sh
37 lines (31 loc) · 1.12 KB
/
repair.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
#!/bin/bash
# Set path to the virtual environment
VENV="$HOME/.dcssb"
echo "Cleaning up the virtual environment ..."
# Attempt to remove the virtual environment directory
rm -rf "$VENV" > /dev/null 2>&1
# Check if the directory still exists after attempting to remove it
if [ -d "$VENV" ]; then
echo "**************************************************"
echo "WARNING: Could not delete the virtual environment."
echo "Please manually delete the .dcssb directory."
echo "Directory Path: $VENV"
echo "**************************************************"
else
echo "Virtual environment cleaned."
echo "A new environment will be created on the next DCSServerBot launch."
fi
# Check if Git is installed
if ! command -v git &> /dev/null; then
# Git not found
echo "Git executable not found, couldn't reset the repository."
else
# Git found, reset the repository
echo "Resetting the GIT repository ..."
git config --global --add safe.directory "$(pwd)" > /dev/null 2>&1
git reset --hard > /dev/null 2>&1
echo "Repository reset."
fi
echo
echo "Please press any key to continue..."
read -n 1