-
-
Notifications
You must be signed in to change notification settings - Fork 533
Expand file tree
/
Copy pathpyenv-delete.sh
More file actions
executable file
·53 lines (41 loc) · 1.32 KB
/
Copy pathpyenv-delete.sh
File metadata and controls
executable file
·53 lines (41 loc) · 1.32 KB
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
51
52
53
#!/usr/bin/env bash
# Author: Luigi Freda
# This file is part of https://github.com/luigifreda/pyslam
#N.B: this install script allows you to run main_slam.py and all the scripts
SCRIPT_DIR_=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # get script dir
SCRIPT_DIR_=$(readlink -f $SCRIPT_DIR_) # this reads the actual path if a symbolic directory is used
ROOT_DIR="$SCRIPT_DIR_"
SCRIPTS_DIR="$ROOT_DIR/scripts"
# ====================================================
# import the bash utils
. "$ROOT_DIR"/bash_utils.sh
STARTING_DIR=`pwd`
cd "$ROOT_DIR"
# ====================================================
#set -e
# Check if conda is installed
if command -v conda &> /dev/null; then
CONDA_INSTALLED=true
else
CONDA_INSTALLED=false
fi
# check if pixi was installed
if [ -d "$ROOT_DIR/.pixi" ]; then
PIXI_INSTALLED=true
else
PIXI_INSTALLED=false
fi
if [ "$PIXI_INSTALLED" = true ]; then
print_blue "Deleting pySLAM environment by using pixi"
. $SCRIPTS_DIR/pyenv-pixi-delete.sh
exit 0
fi
# check that conda is activated
if [ "$CONDA_INSTALLED" = true ]; then
print_blue "Deleting pySLAM environment by using conda"
. $SCRIPTS_DIR/pyenv-conda-delete.sh
else
print_blue "Deleting pySLAM environment by using venv"
. $SCRIPTS_DIR/pyenv-venv-delete.sh
fi
cd "$STARTING_DIR"