Skip to content

Enhancement: dynamic evaluation of commands #882

@davidsneighbour

Description

@davidsneighbour
"frontMatter.custom.scripts": [
{
"command": "~/.nvm/versions/node/v20.18.0/bin/node",
"script": "./bin/frontmatter/screenshot-header-image.cjs",
"title": "Retrieve Screenshot"
},
]

I have a custom script like the above that relies on the command attribute. The problem is that this path/command might change over time, and I am forced to update this configuration every now and then. Technically speaking, the return value of which node would return this path and all its changes. Is it possible somehow to evaluate the content of command so that the resulting path doesn't need to be changed every time?

I remember adding this line because VSCode somehow doesn't respect/find my node/npm versions. They are in "the path," so when I run node in the VSCode terminal, it runs the proper version—just not in those custom scripts. Maybe I am doing something else wrong in the VSCode configuration.

Edit: something like this:

$(which node)

would, under Bash, return the path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In BETAThe current task is available for testing in the BETA version.ReleasedThe task has been releasedenhancementNew feature or requestv10.6.0Project: v10.6.0

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions