Skip to content

Commit

Permalink
Merge pull request #2348 from lf-lang/fix-docker-copy-multiple-files
Browse files Browse the repository at this point in the history
Fixed copying of multiple files in the generated dockerfiles
  • Loading branch information
cmnrd authored Jul 2, 2024
2 parents 31f22b6 + 8578788 commit 9459715
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,15 @@ protected String generateCopyOfUserFiles() {
if (files == null) {
return "# (No user-specified files to be copied.)";
}
var ret = new StringBuilder();
for (var file : files) {
var p = Path.of(file);
var name = p.getFileName().toString();
ret.append(
String.format(
"COPY --from=builder \"lingua-franca/%s/src-gen/%s\" \"./%s\"",
context.getFileConfig().name, name, name));
}
return ret.toString();
return files.stream()
.map(
file -> {
var name = Path.of(file).getFileName().toString();
return String.format(
"COPY --from=builder \"lingua-franca/%s/src-gen/%s\" \"./%s\"",
context.getFileConfig().name, name, name);
})
.collect(Collectors.joining("\n"));
}

/**
Expand Down

0 comments on commit 9459715

Please sign in to comment.