6

Is there a way to refer to the current directory in a .env file?

Trying to point the location of a config file from userprofile, to the current path. For example,

CONFIG_FILE=${USERPROFILE}\.configs\config.cfg

I would like to set it to,

CONFIG_FILE=${CURRENTPATH}\.configs\config.cfg
spitfiredd
  • 2,897
  • 5
  • 32
  • 75

1 Answers1

1

Running my program w/ pipenv on Ubuntu, I'm able to do e.g.:

SETUP_CFG=${PWD}/setup.cfg

And in Python I can do:

import os
from pathlib import Path

assert os.environ.get("SETUP_CFG") == (Path.cwd() / "setup.cfg").as_posix()
fncomp
  • 6,040
  • 3
  • 33
  • 42