From 2121a7e7beeeac612e39d6491cad713f4465bfa0 Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Wed, 19 Jun 2024 23:19:16 -0700 Subject: [PATCH] Address comments from code review --- .../java/org/lflang/generator/docker/DockerGenerator.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/lflang/generator/docker/DockerGenerator.java b/core/src/main/java/org/lflang/generator/docker/DockerGenerator.java index b512b80d54..ea10bc1032 100644 --- a/core/src/main/java/org/lflang/generator/docker/DockerGenerator.java +++ b/core/src/main/java/org/lflang/generator/docker/DockerGenerator.java @@ -157,14 +157,17 @@ protected String generateCopyOfScript() { * property from the builder to the runner. */ protected String generateCopyOfUserFiles() { + if (!context.getTargetConfig().isSupported(FilesProperty.INSTANCE)) { + return ""; + } var files = context.getTargetConfig().get(FilesProperty.INSTANCE); if (files == null) { - return "# (No user-specified files to be copied.)"; + return "# (No user-specified files to be copied.)"; } var ret = new StringBuilder(); for (var file : files) { var p = Path.of(file); - var name = p.getName(p.getNameCount() - 1); + var name = p.getFileName().toString(); ret.append( String.format( "COPY --from=builder \"lingua-franca/%s/src-gen/%s\" \"./%s\"",