Mercurial > hg > config
comparison .bashrc @ 855:8e41e95aac97
indentation
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 17 Dec 2017 12:48:43 -0800 |
parents | d18c46e3a89d |
children | ebfcbbc8a627 |
comparison
equal
deleted
inserted
replaced
854:66321798ac82 | 855:8e41e95aac97 |
---|---|
381 fi | 381 fi |
382 done | 382 done |
383 } | 383 } |
384 | 384 |
385 distribute() { | 385 distribute() { |
386 # upload to pypi | 386 # upload to pypi |
387 python setup.py egg_info sdist register upload develop | 387 python setup.py egg_info sdist register upload develop |
388 } | 388 } |
389 | 389 |
390 render_long_description() { | 390 render_long_description() { |
391 # check the long_description from the command line: | 391 # check the long_description from the command line: |
392 # https://docs.python.org/3.1/distutils/uploading.html#pypi-package-display | 392 # https://docs.python.org/3.1/distutils/uploading.html#pypi-package-display |
393 python setup.py --long-description | rst2html.py > output.html | 393 python setup.py --long-description | rst2html.py > output.html |
394 } | 394 } |
395 | 395 |
396 nearest-venv() { | 396 nearest-venv() { |
397 # find the nearest venv | 397 # find the nearest venv |
398 if [[ "$#" == "0" ]] | 398 |
399 then | 399 if [[ "$#" == "0" ]] |
400 directory=$PWD | 400 then |
401 else | 401 directory=$PWD |
402 directory=$1 | 402 else |
403 fi | 403 directory=$1 |
404 directory=$(python -c "import os; print (os.path.abspath('${directory}'))") | 404 fi |
405 | 405 |
406 while [[ "${directory}" != "/" ]] | 406 directory=$(python -c "import os; print (os.path.abspath('${directory}'))") |
407 do | 407 |
408 activate="${directory}/bin/activate" | 408 while [[ "${directory}" != "/" ]] |
409 if [ -e "${activate}" ] | 409 do |
410 then | 410 activate="${directory}/bin/activate" |
411 echo ${directory} | 411 if [ -e "${activate}" ] |
412 return 0 | 412 then |
413 fi | 413 echo ${directory} |
414 | 414 return 0 |
415 directory=$(dirname ${directory}) | 415 fi |
416 | 416 |
417 done | 417 directory=$(dirname ${directory}) |
418 return 1 | 418 done |
419 return 1 | |
419 } | 420 } |
420 | 421 |
421 activate-nearest() { | 422 activate-nearest() { |
422 # activate the nearest virtualenv | 423 # activate the nearest virtualenv |
423 nearest=$(nearest-venv) | 424 nearest=$(nearest-venv) |