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
I'll open a PR for this myself if you agree with the idea and will review it.
context and file settings seem to be relative to where you run the command from. This is a bit annoying because if you're jumping around in the terminal then all of the sudden your image builds will fail. Currently the repos for my team are set up to have everyone just run everything from the root always.
I've implemented a handful of executors and have started supporting replacement of {absWorkspaceRoot} and {absProjectRoot} tokens for any file paths. It's very simple to do, you can get the necessary information from the executor context. It's also consistent with how nx does it for executor inputs and outputs. Here's an example:
// You can get the root of any project like this and the context provides what the current project is// Workspace root is available directly from `ctx.root`functiongetProjectRoot(ctx: ExecutorContext): string{constprojectRoot=ctx.projectsConfigurations?.projects[String(ctx.projectName)].rootif(!projectRoot){thrownewError(`Could not find project root for ${ctx.projectName}`)}returnprojectRoot;}
Again I'm happy to do the work, just want to know if you agree with the idea first.
The text was updated successfully, but these errors were encountered:
JakeDern
changed the title
Feature Request: Support {workspaceRoot} and {projectRoot} token replacement for file paths
Feature Request: Support {absWorkspaceRoot} and {absProjectRoot} token replacement for file paths
Mar 27, 2024
I'll open a PR for this myself if you agree with the idea and will review it.
context
andfile
settings seem to be relative to where you run the command from. This is a bit annoying because if you're jumping around in the terminal then all of the sudden your image builds will fail. Currently the repos for my team are set up to have everyone just run everything from the root always.I've implemented a handful of executors and have started supporting replacement of
{absWorkspaceRoot}
and{absProjectRoot}
tokens for any file paths. It's very simple to do, you can get the necessary information from the executor context. It's also consistent with how nx does it for executorinputs
andoutputs
. Here's an example:Then you can just replace the tokens:
Again I'm happy to do the work, just want to know if you agree with the idea first.
The text was updated successfully, but these errors were encountered: