# HG changeset patch # User Jeff Hammel # Date 1513543723 28800 # Node ID 8e41e95aac97dae3887b37801843f293208b17ef # Parent 66321798ac82425e97d346ba601cda7e07212dcf indentation diff -r 66321798ac82 -r 8e41e95aac97 .bashrc --- a/.bashrc Mon Dec 11 16:56:22 2017 +0000 +++ b/.bashrc Sun Dec 17 12:48:43 2017 -0800 @@ -383,39 +383,40 @@ } distribute() { -# upload to pypi + # upload to pypi python setup.py egg_info sdist register upload develop } render_long_description() { -# check the long_description from the command line: -# https://docs.python.org/3.1/distutils/uploading.html#pypi-package-display + # check the long_description from the command line: + # https://docs.python.org/3.1/distutils/uploading.html#pypi-package-display python setup.py --long-description | rst2html.py > output.html } nearest-venv() { -# find the nearest venv -if [[ "$#" == "0" ]] -then -directory=$PWD -else -directory=$1 -fi -directory=$(python -c "import os; print (os.path.abspath('${directory}'))") + # find the nearest venv + + if [[ "$#" == "0" ]] + then + directory=$PWD + else + directory=$1 + fi + + directory=$(python -c "import os; print (os.path.abspath('${directory}'))") -while [[ "${directory}" != "/" ]] -do -activate="${directory}/bin/activate" -if [ -e "${activate}" ] -then -echo ${directory} -return 0 -fi + while [[ "${directory}" != "/" ]] + do + activate="${directory}/bin/activate" + if [ -e "${activate}" ] + then + echo ${directory} + return 0 + fi -directory=$(dirname ${directory}) - -done -return 1 + directory=$(dirname ${directory}) + done + return 1 } activate-nearest() {