Skip to content

Commit

Permalink
Merge pull request #246 from boot-clj/issue-243-boot-local-repo-md5
Browse files Browse the repository at this point in the history
make environment variable BOOT_LOCAL_REPO usable on windows
  • Loading branch information
micha committed Jul 9, 2015
2 parents 7381d5c + f890456 commit b5e78fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions boot/base/src/main/java/boot/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ public static class Exit extends Exception {
ensureResourceFile(aetherjar, aetherfile);
aethershim = newShim(new File[] { aetherfile }); }
return aethershim; }


private static String
md5hash(String data) throws Exception {
java.security.MessageDigest algo = java.security.MessageDigest.getInstance("MD5");
return javax.xml.bind.DatatypeConverter.printHexBinary(algo.digest(data.getBytes())); }

public static void
extractResource(String resource, File outfile) throws Exception {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Expand Down Expand Up @@ -282,7 +287,7 @@ public static class Exit extends Exception {

String dir_l = (localrepo == null)
? "boot/default"
: "boot/custom" + (new File(localrepo)).getCanonicalFile().getPath();
: "boot/custom/" + md5hash((new File(localrepo)).getCanonicalFile().getPath());

if (clj_v != null) cljversion = clj_v;
if (boot_v != null) bootversion = boot_v;
Expand Down

0 comments on commit b5e78fd

Please sign in to comment.