comparison .bashrc @ 651:66a7729aa049

fix this function
author Jeff Hammel <k0scist@gmail.com>
date Fri, 28 Mar 2014 18:55:49 -0700
parents fbfc02ea7d8e
children 60952012be78
comparison
equal deleted inserted replaced
650:9cb40c01c10a 651:66a7729aa049
422 VIRTUALENV="virtualenv.py" 422 VIRTUALENV="virtualenv.py"
423 if ! which ${VIRTUALENV} 423 if ! which ${VIRTUALENV}
424 then 424 then
425 return 1 425 return 1
426 fi 426 fi
427 VENV_PATH=$(which ${VIRTUALENV} &> /dev/null) 427 VENV_PATH=$(which ${VIRTUALENV})
428 echo VENV_PATH=${VENV_PATH}
428 429
429 # update virtualenv if possible 430 # update virtualenv if possible
430 DIRNAME=$(dirname ${VENV_PATH}) 431 DIRNAME=$(dirname ${VENV_PATH})
431 if [ -d "${DIRNAME}/.git" ] 432 if [ -d "${DIRNAME}/.git" ]
432 then 433 then
433 cd "${DIRNAME}" 434 cd "${DIRNAME}"
434 git pull 435 git pull
435 cd -- 436 cd --
436 fi 437 fi
437 438
438
439 # for each virtualenv given... 439 # for each virtualenv given...
440 for i in $@ 440 for i in $@
441 do 441 do
442 OLD_PWD=${PWD}
443 echo "${i} : OLDPWD=${OLD_PWD}"
442 # ...recreate it... 444 # ...recreate it...
443 ${VIRTUALENV} --clear "${i}" 445 ${VIRTUALENV} --clear "${i}"
444 446
445 SRCDIR="${i}"/src 447 SRCDIR="${i}"/src
446 if [ -d "${SRCDIR}" ] 448 if [ -d "${SRCDIR}" ]
447 then 449 then
448 . "${i}/bin/activate" 450 . "${i}/bin/activate"
449 OLDPWD=${PWD}
450 cd "${SRCDIR}" 451 cd "${SRCDIR}"
451 for j in * 452 for j in *
452 do 453 do
453 if [ -e "${j}"/setup.py ] 454 if [ -e "${j}"/setup.py ]
454 then 455 then
455 cd "${j}" 456 cd "${j}"
456 python setup.py develop 457 python setup.py develop
457 cd .. 458 cd ..
458 fi 459 fi
459 done 460 done
460 cd "${OLDPWD}"
461 fi 461 fi
462 echo "cd OLD_PWD=${OLD_PWD}"
463 cd ${OLD_PWD}
462 done 464 done
463 } 465 }
464 466
465 ### functions for version control systems 467 ### functions for version control systems
466 468