Skip to content

jbang template does not handle bad template file #2396

@maxandersen

Description

@maxandersen
jbang init -t jbang test
[jbang] [ERROR] Cannot invoke "dev.jbang.resources.ResourceRef.getOriginalResource()" because the return value of "dev.jbang.source.RefTarget.getSource()" is null
[jbang] Run with --verbose or -x for more details. The --verbose or -x must be placed before the jbang command. I.e. jbang --verbose run [...]

happens if file-refs have a file that does not exist, i.e.

"templates": {
    "jbang": {
      "file-refs": {
        "{basename}/{basename}App.java.qute": "templates/jbang/HelloToolkitApp.java",
        "{basename}/.gitignore": "templates/jbang/.gitignore",
        "{basename}/README.md": "templates/jbang/README.md"
      },
      "properties": {}
    }
  }

where HelloToolkitApp.java is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions