jbang icon indicating copy to clipboard operation
jbang copied to clipboard

should `//FILES /=../resources` be allowed when `//FILES ../resources` is?

Open maxandersen opened this issue 2 years ago • 4 comments

we have a check against absolute paths so currently you can't write //FILES /=../resources though //FILES ../resources is allowed

Alternatively could be to allow //FILES .=./resources but that fails because '. is not known file (probably missing a resolve).

maxandersen avatar Aug 13 '23 16:08 maxandersen

@maxandersen while playing around with jBang I stumbled upon this bug. When I try to add resource files for i18n they are not found/taken into account.

Is this behaviour part of this bug?

See https://github.com/ottlinger/spamschutz/commit/c9eb68592d6527da4f29c1b928cbab79a90132a9 for my example app.

The app starts, but cannot find the resource bundles: $ jbang src/main/java/de/aikiit/spamprotector/AntiSpamApplication.java

Caused by: java.util.MissingResourceException: Can't find bundle for base name spamprotector, locale de_DE

ottlinger avatar Aug 16 '23 13:08 ottlinger

I don't think it's same issue. You are using ** thus it tries to match but nothing found which we don't treat as error. Only treat non patterns as error if no match.

Your issue is more that you don't seem to be using path relative to what file you are in as I think you don't have src folder in same location.

maxandersen avatar Aug 16 '23 18:08 maxandersen

proposed fix at https://github.com/ottlinger/spamschutz/pull/307

maxandersen avatar Aug 16 '23 20:08 maxandersen

@maxandersen thanks for your help, I updated the docs to make it even more explicit that paths need to be main-script-relative - https://github.com/jbangdev/jbang/pull/1669

ottlinger avatar Aug 18 '23 07:08 ottlinger