Skip to content

Commit 68e16e8

Browse files
Kyle Harringtonctrueden
Kyle Harrington
authored andcommitted
Use sha256 hash of extra coordinates for cache dir name
1 parent 9c8ad07 commit 68e16e8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jgo/jgo.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
import traceback
1212
import zipfile
13+
import hashlib
1314

1415
# A script to execute a main class of a Maven artifact
1516
# which is available locally or from Maven Central.
@@ -521,7 +522,9 @@ def coordinates_from_endpoints(endpoints):
521522

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

527530

0 commit comments

Comments
 (0)