pppindex/setenv
2021-12-10 13:56:36 +01:00

39 lines
834 B
Bash
Executable File

#!/bin/bash
if [ ! -d "venv/" ]
then
echo "venv DOES NOT exists..."
if [[ "$(read -e -p 'Setup venv? [y/N]> '; echo $REPLY)" == [Yy]* ]]
then
echo "Creating python3 venv"
python3 -m venv venv/
echo "Done."
else
echo "Aborting..."
return
fi
fi
source venv/bin/activate
if [ ! "$(pip list | grep -F pppadump)" ]
then
echo "pppadump IS NOT installed"
if [[ "$(read -e -p 'pip install pppadump? [y/N]> '; echo $REPLY)" == [Yy]* ]]
then
echo "Pip installing pppadump"
if [ ! "$(pip install -e pppadump/)" ]
then
echo "pppadum doesn't seem to be fetched yet. Run the following git command to do so (and run setenv again):"
echo "> git submodule update --init --recursive"
return
else
echo "Done."
fi
else
echo "Aborting..."
return
fi
fi
echo "--------------------------------> env set"