File tree Expand file tree Collapse file tree 3 files changed +125
-0
lines changed Expand file tree Collapse file tree 3 files changed +125
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Name of the conda environment
4
+ ENV_NAME=" data-curation"
5
+ PATHFILE=" dataset_curation_path.txt"
6
+
7
+ echo " Starting uninstallation of the '$ENV_NAME ' environment."
8
+
9
+ # Check if conda is installed
10
+ if ! command -v conda & > /dev/null
11
+ then
12
+ echo " Conda is not installed. Nothing to uninstall."
13
+ exit 0
14
+ fi
15
+
16
+ # Deactivate any active conda environment
17
+ conda deactivate
18
+
19
+ # Check if the environment exists
20
+ if conda env list | grep -q " $ENV_NAME "
21
+ then
22
+ echo " Removing conda environment '$ENV_NAME '..."
23
+ conda env remove -n " $ENV_NAME "
24
+ else
25
+ echo " Conda environment '$ENV_NAME ' does not exist."
26
+ fi
27
+
28
+ # Remove the Dataset-Curation-Tool directory if it exists
29
+ if [ -f " $PATHFILE " ]; then
30
+ STORED_PATH=$( < " $PATHFILE " )
31
+ if [ -d " $STORED_PATH " ]; then
32
+ echo " Removing 'Dataset-Curation-Tool' directory at '$STORED_PATH '..."
33
+ rm -rf " $STORED_PATH "
34
+ else
35
+ echo " Directory '$STORED_PATH ' does not exist."
36
+ fi
37
+ # Remove the path file
38
+ rm -f " $PATHFILE "
39
+ fi
40
+
41
+ echo " Uninstallation complete."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Name of the conda environment
4
+ ENV_NAME=" data-curation"
5
+ PATHFILE=" dataset_curation_path.txt"
6
+
7
+ echo " Starting uninstallation of the '$ENV_NAME ' environment."
8
+
9
+ # Check if conda is installed
10
+ if ! command -v conda & > /dev/null
11
+ then
12
+ echo " Conda is not installed. Nothing to uninstall."
13
+ exit 0
14
+ fi
15
+
16
+ # Deactivate any active conda environment
17
+ conda deactivate
18
+
19
+ # Check if the environment exists
20
+ if conda env list | grep -q " $ENV_NAME "
21
+ then
22
+ echo " Removing conda environment '$ENV_NAME '..."
23
+ conda env remove -n " $ENV_NAME "
24
+ else
25
+ echo " Conda environment '$ENV_NAME ' does not exist."
26
+ fi
27
+
28
+ # Remove the Dataset-Curation-Tool directory if it exists
29
+ if [ -f " $PATHFILE " ]; then
30
+ STORED_PATH=$( < " $PATHFILE " )
31
+ if [ -d " $STORED_PATH " ]; then
32
+ echo " Removing 'Dataset-Curation-Tool' directory at '$STORED_PATH '..."
33
+ rm -rf " $STORED_PATH "
34
+ else
35
+ echo " Directory '$STORED_PATH ' does not exist."
36
+ fi
37
+ # Remove the path file
38
+ rm -f " $PATHFILE "
39
+ fi
40
+
41
+ echo " Uninstallation complete."
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ SETLOCAL
3
+
4
+ SET ENV_NAME = data-curation
5
+ SET PATHFILE = dataset_curation_path.txt
6
+
7
+ echo Starting uninstallation of the '%ENV_NAME% ' environment.
8
+
9
+ REM Check if conda is installed
10
+ IF EXIST " %UserProfile% \Miniconda3\Scripts\conda.exe" (
11
+ echo Conda is installed.
12
+ ) ELSE (
13
+ echo Conda is not installed. Nothing to uninstall.
14
+ GOTO :EOF
15
+ )
16
+
17
+ REM Deactivate any active conda environment
18
+ call conda deactivate
19
+
20
+ REM Check if the environment exists
21
+ call conda env list | findstr /C:" %ENV_NAME% " > nul
22
+ IF %ERRORLEVEL% EQU 0 (
23
+ echo Removing conda environment '%ENV_NAME% '...
24
+ call conda env remove -n " %ENV_NAME% "
25
+ ) ELSE (
26
+ echo Conda environment '%ENV_NAME% ' does not exist.
27
+ )
28
+
29
+ REM Remove the Dataset-Curation-Tool directory if it exists
30
+ IF EXIST " %PATHFILE% " (
31
+ set /p STORED_PATH = < " %PATHFILE% "
32
+ IF EXIST " %STORED_PATH% " (
33
+ echo Removing 'Dataset-Curation-Tool' directory at '%STORED_PATH% '...
34
+ rmdir /S /Q " %STORED_PATH% "
35
+ ) ELSE (
36
+ echo Directory '%STORED_PATH% ' does not exist.
37
+ )
38
+ del " %PATHFILE% "
39
+ )
40
+
41
+ echo Uninstallation complete.
42
+
43
+ ENDLOCAL
You can’t perform that action at this time.
0 commit comments