Skip to content

Commit

Permalink
Skip the intermediate shell-script on Unix
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Oct 10, 2023
1 parent 8bb9530 commit 6da957c
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,19 @@ public static ProcessConnection ofExecutable(File executable) throws IOException
cmd.add(dartExe.getAbsolutePath());
cmd.add(sassSnapshot.getAbsolutePath());
}
} else {
} else if (executable.length() < 1024) { // small shell-script
File dir = executable.getParentFile();

File dart = new File(dir, "src/dart");
File sassSnapshot = new File(dir, "src/sass.snapshot");

if (dart.isFile() && dart.canExecute() && sassSnapshot.isFile()) {
cmd.add(dart.getAbsolutePath());
cmd.add(sassSnapshot.getAbsolutePath());
}
}

if (cmd.isEmpty()) {
if (!executable.canExecute()) {
throw new IllegalArgumentException(executable + " can not be executed");
}
Expand Down

0 comments on commit 6da957c

Please sign in to comment.