Skip to content

Commit ea71f13

Browse files
authored
Merge pull request #211 from chescales/fix/windows-docker-compose-path
Fixed bug where windows paths would not find the `/data` volume.
2 parents d0a7346 + c64626d commit ea71f13

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

divio_cli/localdev/utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,20 @@ def has_service(self, service):
163163
return service in self.get_services().keys()
164164

165165
def has_volume_mount(self, service, remote_path):
166+
"""
167+
Services may look like the following depending on the OS:
168+
169+
- /home/user/some/path:/app:rw
170+
- C:\whatever\windows\path:/app:rw (windows)
171+
"""
166172
try:
167173
service_config = self.get_services()[service]
168174
except KeyError:
169175
return False
170176

171177
for mount in service_config.get('volumes', []):
172-
data = mount.split(':')
173-
if data[1] == remote_path:
178+
bits = mount.strip().split(':')
179+
if len(bits) > 2 and bits[-2] == remote_path:
174180
return True
175181

176182

0 commit comments

Comments
 (0)