mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 15:13:38 +01:00
Properties reader should be loaded for pkl project package #305
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @discount-elf on GitHub (Apr 26, 2025).
It would be useful to be able to do the following:
pkl project package -p 'version=1.0.1'PklProject
Currently pkl
0.28.1complains about the prop module reader not being present. I couldn't get it working tweaking any combination of--allowed-resourcesand--allowed-modules@bioball commented on GitHub (May 7, 2025):
We don't allow external properties when loading
PklProjectbecause that module is somewhat special; it's a manifest that controls Pkl evaluation in a normal program. E.g. throughevaluatorSettings:When you eval another module, the
PklProjectfirst gets evaluated, and any settings therein are applied to the rest of the evaluation. We want external properties to specifically be an input to a "normal" program.If you want to set the version from an external source, you have two choices:
version = read("env:VERSION"))version = read("VERSION.txt").text.trim())I'd recommend the second approach, because this allows IDEs to run the sync projects action.
@discount-elf commented on GitHub (May 7, 2025):
Ah got it. Yes I was using the second approach before filing! Thank you!