Skip to content

Commit 838936b

Browse files
committed
Add PYTHONX_CACHE_DIR to customize cache location
1 parent 6cb3f67 commit 838936b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/pythonx/uv.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,13 @@ defmodule Pythonx.Uv do
166166
@version Mix.Project.config()[:version]
167167

168168
defp cache_dir() do
169-
base_dir = :filename.basedir(:user_cache, "pythonx")
169+
base_dir =
170+
if dir = System.get_env("PYTHONX_CACHE_DIR") do
171+
Path.expand(dir)
172+
else
173+
:filename.basedir(:user_cache, "pythonx")
174+
end
175+
170176
Path.join([base_dir, @version, "uv", @uv_version])
171177
end
172178

0 commit comments

Comments
 (0)