in tc-sbt-runner-agent/src/main/java/jetbrains/buildServer/sbt/SbtRunnerBuildService.java [315:332]
private List<String> getCommandsFromFile(@NotNull String args, SBTVersion sbtVersion) {
try {
File file = FileUtil.createTempFile(getAgentTempDirectory(), "commands", ".file", true);
String content = String.format(INFILE_COMMANDS_FORMATTER, getApplyCommand(sbtVersion), getCheckStatusCommand(), prepareArgs(args));
String name = file.getAbsolutePath();
getLogger().activityStarted("Prepare SBT run", "Write commands to file.", BUILD_ACTIVITY_TYPE);
getLogger().message("File name: " + name + "; content: " + content);
getLogger().activityFinished("Prepare SBT run", BUILD_ACTIVITY_TYPE);
FileUtil.writeFile(file, content, "UTF-8");
List<String> commands = new ArrayList<String>();
String fileNameQuotes = SystemInfo.isWindows ? "\"\"" : "\"";
commands.add(String.format(RUN_INFILE_COMMANDS_FORMATTER, fileNameQuotes + name.replace('\\', '/') + fileNameQuotes));
return commands;
} catch (IOException e) {
LOG.warn(e.getMessage(), e);
return Collections.emptyList();
}
}