Skip to content

Instantly share code, notes, and snippets.

@mondeja
Last active October 28, 2017 12:54
Show Gist options
  • Save mondeja/7c8eb7dcc65dd85dfde3576d0305b025 to your computer and use it in GitHub Desktop.
Save mondeja/7c8eb7dcc65dd85dfde3576d0305b025 to your computer and use it in GitHub Desktop.
Selecciona un entorno virtual
#!/bin/bash
echo && echo "Selecciona el entorno virtual que quieres usar"
echo "1. Python (pyenv)"
echo "2. NodeJS (jsenv)"
echo "3. Ruby (rbenv)"
read -n 1 c
if [ $c == 1 ]; then
source pyenv/bin/activate
elif [ $c == 2 ]; then
source jsenv/bin/activate
else
source rbenv/bin/activate
fi
# Source
# https://www.cyberciti.biz/faq/linux-unix-read-one-character-atatime-while-loop/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment