-
Notifications
You must be signed in to change notification settings - Fork 7
/
linux_uninstall.sh
41 lines (34 loc) · 1 KB
/
linux_uninstall.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
#!/bin/bash
# Name of the conda environment
ENV_NAME="data-curation"
PATHFILE="dataset_curation_path.txt"
echo "Starting uninstallation of the '$ENV_NAME' environment."
# Check if conda is installed
if ! command -v conda &> /dev/null
then
echo "Conda is not installed. Nothing to uninstall."
exit 0
fi
# Deactivate any active conda environment
conda deactivate
# Check if the environment exists
if conda env list | grep -q "$ENV_NAME"
then
echo "Removing conda environment '$ENV_NAME'..."
conda env remove -n "$ENV_NAME"
else
echo "Conda environment '$ENV_NAME' does not exist."
fi
# Remove the Dataset-Curation-Tool directory if it exists
if [ -f "$PATHFILE" ]; then
STORED_PATH=$(<"$PATHFILE")
if [ -d "$STORED_PATH" ]; then
echo "Removing 'Dataset-Curation-Tool' directory at '$STORED_PATH'..."
rm -rf "$STORED_PATH"
else
echo "Directory '$STORED_PATH' does not exist."
fi
# Remove the path file
rm -f "$PATHFILE"
fi
echo "Uninstallation complete."