Skip to content

Commit b4e755a

Browse files
author
Kyle Harrington
committed
Use sha256 hash of extra coordinates for cache dir name
1 parent e5a39c5 commit b4e755a

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.
@@ -484,7 +485,9 @@ def coordinates_from_endpoints(endpoints):
484485

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

490493

0 commit comments

Comments
 (0)