You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently support replacement syntax like GitHub actions via ${{ }} which currently is only supported in ENV, but could be extended to further strings.
This replacement syntax currently only supports a single uppercase expression of another ENV var to replace into the string.
The proposal would be to extend the replacement system to support functions - someFunction(...) with comma-separated arguments, including strings and literals.
For example:
[env]
NAME = "${{ readFile('name.txt') }}"
would set an environment variable from the contents of a file.
Common configuration formats could also be supported:
[env]
VERSION = "${{ json('package.json', 'version') }}"
would set the VERSION environment variable to the contents of the package.json "version" field.
There would be no participation in the task graph, so one would still need to add these files into the task graph normally.
Alternatively we could automatically treat any file dependencies caused by these functions as dependencies of all tasks, just like in theory the chompfile.toml itself should really be. Possibly even exposing this feature separately as a top-level global-deps = ["chompfile.toml"], for dependencies of all tasks.
The text was updated successfully, but these errors were encountered:
Global environment functions referencing files would be global dependency additions, while task-local environment functions referencing files would be task-specific dependency additions.
We currently support replacement syntax like GitHub actions via
${{ }}
which currently is only supported in ENV, but could be extended to further strings.This replacement syntax currently only supports a single uppercase expression of another ENV var to replace into the string.
The proposal would be to extend the replacement system to support functions -
someFunction(...)
with comma-separated arguments, including strings and literals.For example:
would set an environment variable from the contents of a file.
Common configuration formats could also be supported:
would set the
VERSION
environment variable to the contents of the package.json "version" field.There would be no participation in the task graph, so one would still need to add these files into the task graph normally.
Alternatively we could automatically treat any file dependencies caused by these functions as dependencies of all tasks, just like in theory the
chompfile.toml
itself should really be. Possibly even exposing this feature separately as a top-levelglobal-deps = ["chompfile.toml"]
, for dependencies of all tasks.The text was updated successfully, but these errors were encountered: