#! /bin/bash
if [[ "$VIRTUAL_ENV" != "" ]]
then
echo "running within virtual env-t... cont'd"
else
echo "make sure to run it from within the virtual environment, e.g. after pipenv shell"
exit 1
fi
interpreter=$(which python)
if [ ! -d ".vscode" ]
then
mkdir .vscode
fi
cd .vscode
file="settings.json"
cat <<EOF >$file
{
"python.pythonPath": "py_py_path"
}
EOF
sed -i "s|py_py_path|$interpreter|g" $file
echo "completed"