Skip to content

Commit

Permalink
Use SystemUtils.JAVA_IO_TMPDIR when unpacking from JAR
Browse files Browse the repository at this point in the history
  • Loading branch information
dabico committed Jan 7, 2025
1 parent 45b1e17 commit c98480b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/ch/usi/si/seart/cloc/CLOC.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public final class CLOC {

private static final String CMD = "cloc";

private static final String TMPDIR_PATH = System.getProperty("java.io.tmpdir");

private static final String EXECUTABLE = getBundledExecutable();

private static final JsonMapper DEFAULT_MAPPER = new JsonMapper();
Expand Down Expand Up @@ -78,8 +76,7 @@ private static String getBundledExecutable() {
return new File(url.getFile()).getPath();
case "jar":
try {
File tmpdir = new File(TMPDIR_PATH);
File script = new File(tmpdir, CMD);
File script = new File(SystemUtils.JAVA_IO_TMPDIR, CMD);
FileUtils.copyURLToFile(url, script);
boolean ignore = script.setExecutable(true);
script.deleteOnExit();
Expand Down

0 comments on commit c98480b

Please sign in to comment.