开发者

Creating a directory inside a virtualenv via virtualenvwrapper's postmkvirtualenv

开发者 https://www.devze.com 2023-02-09 07:17 出处:网络
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 ha

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

精彩评论

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