开发者

Creating a directory inside a virtualenv via virtualenvwrapper's postmkvirtualenv

Inside every virtualenv of mine, I开发者_开发知识库 add a directory named run, this is where i put running pid files and logs, etc. I noticed that postmkvirtualenv can help me make sure this always happens when I create a new virtualenv but im not sure how to implement. I would say mkdir $VIRTUAL_HOME/$VIRTUALENV/run but $VIRTUALENV is not available... I know it's possible, just not sure how.


You probably want to use the $VIRTUAL_ENV variable instead.

Example postmkvirtalenv:

#!/bin/bash
mkdir "${VIRTUAL_ENV}"/run

The variable is quoted to protect against spaces in the path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜