Skip to content

Commit 4abdcc7

Browse files
author
Kyle Harrington
committed
Update workspace dir path, write coordinates into workspace
Workspace dir is now ~/.jgo/${groupId}/${artifactId}/${version}/hash Coordinates are written into workspace as coordinates.txt
1 parent b4e755a commit 4abdcc7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

jgo/jgo.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ def coordinates_from_endpoints(endpoints):
484484

485485

486486
def workspace_dir_from_coordinates(coordinates, cache_dir):
487-
workspace = os.path.join(cache_dir, *coordinates[0])
488-
coord_string = '+'.join(['-'.join(c) for c in coordinates[1:]])
487+
coord_string = '+'.join(['-'.join(c) for c in coordinates])
489488
hash_path = hashlib.sha256(coord_string.encode('utf-8')).hexdigest()
490-
workspace = '+'.join([workspace, hash_path])
489+
workspace = os.path.join(cache_dir, *coordinates[0], hash_path)
490+
491491
return workspace
492492

493493

@@ -545,6 +545,11 @@ def resolve_dependencies(endpoint_string,
545545

546546
os.makedirs(workspace, exist_ok=True)
547547

548+
# Write a file with the coordinates into the workspace dir
549+
with open(os.path.join(workspace, 'coordinates.txt'), 'w') as f:
550+
for coordinate in coordinates:
551+
f.write(''.join([':'.join(coordinate)] + ['\n']))
552+
548553
# TODO should this be for all endpoints or only the primary endpoint?
549554
if manage_dependencies:
550555
dependency_management = '<dependency><groupId>{g}</groupId><artifactId>{a}</artifactId><version>{v}</version>'.format(

0 commit comments

Comments
 (0)