Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions conans/client/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def new_config(self):
distro = None
if platform.system() in ["Linux", "FreeBSD"]:
import distro
base_path = os.path.dirname(self.new_config_path)
template = Environment(loader=FileSystemLoader(base_path)).from_string(text)
template = Environment(loader=FileSystemLoader(self.cache_folder)).from_string(text)
content = template.render({"platform": platform, "os": os, "distro": distro,
"conan_version": conan_version})
"conan_version": conan_version,
"conan_home_folder": self.cache_folder})

self._new_config.loads(content)
return self._new_config
Expand Down
8 changes: 8 additions & 0 deletions conans/test/integration/configuration/conf/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ def test_jinja_global_conf_include(client):
assert "user.mycompany:dist=84" in client.out


def test_jinja_global_conf_paths():
c = TestClient()
global_conf = 'user.mycompany:myfile = {{os.path.join(conan_home_folder, "myfile")}}'
save(c.cache.new_config_path, global_conf)
c.run("config show *")
assert f"user.mycompany:myfile: {os.path.join(c.cache_folder, 'myfile')}" in c.out


def test_empty_conf_valid():
tc = TestClient()
profile = textwrap.dedent(r"""
Expand Down