Skip to content

Commit afd88b0

Browse files
Kyle Harringtonctrueden
Kyle Harrington
authored andcommitted
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 68e16e8 commit afd88b0

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
@@ -521,10 +521,10 @@ def coordinates_from_endpoints(endpoints):
521521

522522

523523
def workspace_dir_from_coordinates(coordinates, cache_dir):
524-
workspace = os.path.join(cache_dir, *coordinates[0])
525-
coord_string = "+".join(["-".join(c) for c in coordinates[1:]])
524+
coord_string = "+".join(["-".join(c) for c in coordinates])
526525
hash_path = hashlib.sha256(coord_string.encode("utf-8")).hexdigest()
527-
workspace = "+".join([workspace, hash_path])
526+
workspace = os.path.join(cache_dir, *coordinates[0], hash_path)
527+
528528
return workspace
529529

530530

@@ -587,6 +587,11 @@ def resolve_dependencies(
587587

588588
os.makedirs(workspace, exist_ok=True)
589589

590+
# Write a file with the coordinates into the workspace dir
591+
with open(os.path.join(workspace, "coordinates.txt"), "w") as f:
592+
for coordinate in coordinates:
593+
f.write("".join([":".join(coordinate)] + ["\n"]))
594+
590595
# TODO should this be for all endpoints or only the primary endpoint?
591596
if manage_dependencies:
592597
dependency_management = "<dependency><groupId>{g}</groupId><artifactId>{a}</artifactId><version>{v}</version>".format(

0 commit comments

Comments
 (0)