Expand ~ in _create_bind_dir_if_relative

Paths like ~/.credentials/... were treated as relative because ~
is not absolute. expanduser resolves them to /home/user/... before
the check, preventing creation of a literal "~" directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pull/742/head
Prathamesh Musale 2026-04-14 11:51:17 +00:00
parent fa55a75e5b
commit ddd399cd07
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ def _get_named_volumes(stack):
# so the deployment will start
# Also warn if the path is absolute and doesn't exist
def _create_bind_dir_if_relative(volume, path_string, compose_dir):
path = Path(path_string)
path = Path(os.path.expanduser(path_string))
if not path.is_absolute():
absolute_path = Path(compose_dir).parent.joinpath(path)
absolute_path.mkdir(parents=True, exist_ok=True)